|
I'm a bit confused Do you want to run or open files?
In first case take a look at the Process and ProcessStartInfo classes and in second case look at the System.IO namespace.
If that doesn't help, please be a bit more specific.
www.troschuetz.de
|
|
|
|
|
sorry, I need to be able to simply execute a file. also, while your reading this, how do I uninstall a program that is registered in the control panel, but doesn't come with an uninstaller. I mean, is there a way to "open" the control panel and remove the program with that through code. How would I go about doing that?
Danke Schon.
|
|
|
|
|
"sorry, I need to be able to simply execute a file":
As I stated in my previous posting take a look at the Process and ProcessStartInfo classes. The appropriate MSDN topics provide some examples, so you should have no problems with that. Otherwise let me know what concretely doesn't work.
"is there a way to "open" the control panel and remove the program with that through code":
As far as I know the list of installed programs that is accessible through the control panel is based on information inside the registry. So to "uninstall" the program you'll have to remove the right registry entries, which is possible in .NET (RegistryKey and Registry classes). But please don't take this for granted as havn't much experience in this field and maybe start a new thread with this particular problem.
www.troschuetz.de
|
|
|
|
|
I am a student of a c programming class in Texas. Our teacher is one that does not assist all that much but chooses to leave us to our own devices in programming his projects. That said, i am asking for any assistance that may be given in helping me write a program that
"can reverse the characters in a word, but leave it in its original position in the sentence"
Heres what ive coded so far:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char imput[100]=" interesting, this class of robotics";
char list1[30][50];
char databank[50];
int i=0;
int j=0;
int k=0;
while(j<30){
j++;
while(k<50){
k++;
list1[j][k]=0;}
}
while(imput[i] !=0){
if (imput[i]=32){
j++;
k=0;
i++;}
else{
list1[j][k]=imput[i];
k++;
i++;}
}
for (k=0;k<60;k++){
for (j=0;j<30;j++){
printf("%c",list1[j][k]);
}
}
i=0;
while(i<30){
databank[i]=0;
i++;}
for(i=0;i<60;i++){
while(list1[j][k] !=0){
databank[i]=list1[j][k];
i++;
k++;
if(list1[j][k]=32){j++;}
}}
i=0;
while(i !=20){
printf("%c\n",databank[i]);
i++;}
// j--;
// k=0;
// while(j>-1){
// list1[j][k]=databank[j];
/// j--;
// k++;}
// }
// for (k=0;k<60;k++){
// for (j=0;j<30;j++){
// printf("%c",list1[j][k]);
// }
// }
system("PAUSE");
return 0;
}
Our next project is to sort a list of integers in ascending order, ill happily accept any help offered on either of these projects.
Thanks
Bill
|
|
|
|
|
Hi, Im using directx9 to show an .avi movie in a picture box. The movie is copy file movie that comes with visual studio in ...Microsoft Visual Studio .NET\Common7\Graphics\videos folder.
This movie has a pink or magenta background, I want suupress it to show the picturebox bakground color.
I have try many things but I cxant do it.
system.drawin.bittmap has a methos makeetransparent with a color in pareamete. I neeed an similar method for Microsoft.DirectX.AudioVideoPlayback.Video class.
How can I do that?
Thank you, Luis Ruiz
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
I don't think it's that easy. How do you know the color of a specific pixel? if you can read it you probably can overwrite it.
try reading this[^]
there are no facts, only interpretations
|
|
|
|
|
Ladies & Gentlemen
I have two issues when dealing with windows forms data binding.
1-I have created a windows form . And on it I have added tab control which has other controls .
I f I create a method to clear all controls on the form of data. Only controls on the tab that has focus are cleared of data. others remain uncleared and especially ComboBoxes.
How can I write a method to clear my form after data entry.
2-Second issue ,I have employee details. I have Banks and Each bank has branches. I want to create ComboBox that list all Banks and this should be linked to Branches ComboBox and the branches comboxBox should have its SelectedValue pointed to employee data row. That is it should make the look up table containing bank branches form employee data.
Meaning that if an employee has his account with ABC bank ,it should also specify the branch. That is I have a list of branches for each bank.
How can I implement this lookup hierarchy.
Amour Rashid Hamad
P.O.Box 9294
Directorate Of Information Services (TTCL)
Dar Es Salaam
Tanzania
|
|
|
|
|
Hi
How i can retrive an resource (Bitmap for handle) from my project.Before now i handn't experince with .Net resorces
and i anticipate this in the same way like in MFC projects, but there is no resource files, and i just add my bitmap inderectly to project(Project->Add New Item->Bitmap)is it correct? .And now i want to get the bitmap ID from my code.
Where is a way to do so??
Thank.
|
|
|
|
|
|
Thank.
Oddly enough, i suppose using resorces in NET became more
simplest, but in oppositely it seems more complicated.
|
|
|
|
|
no not really, the only importand thing is:
ResourceManager rm = new ResourceManager("app", this.GetType().Assembly);<br />
<br />
rm.GetObject( "keyname" );<br />
rm.GetString( "keyname" );<br />
no big deal - for editing resources u can use Resourcer[^]
|
|
|
|
|
In .NET 2.0, it's become even easier:
Image myImage = Properties.Resources.arrow;
Any remotely useful information on my blog will be removed immediately.
Judah Himango
|
|
|
|
|
Hi,
is it possible to set a row fixed under the header of a column so when i scoll it's always on top too?
if tried some overrides but i don't really know where to begin? Changing things like the scrollbar values don't fix the row on the top.
Any ideas?
|
|
|
|
|
Hi all
I have developed a com interop application in C#, its output is .dll.
It is working fine in the workstation (win XP)
Now I wand manually (Again Manually) deploy the same DLL in windows 2003 server, the server already has .net Framework,Can any one tell me how to deplay the com interop DLL?
More over I am integrating the C# DLL with a VC++ (Version 6) Client, the client will read the CLSID from the registry and create the instance of the .net component.In this case can any one guide me that how to deploy the interop component?
Thanks
|
|
|
|
|
|
I have a custom class within my code and I place multiple instances of this class into an ArrayList. At certain points in the code I would like to check if an instance of an object already exists in the array (not really an instance as such, more an object with the same values).
Now this doesnt work, I am certain that I am expecting far to much from the .Contains() function - so if anybody has any guidance on another solution please post it up.
As an example of the "problem" :
The following code returns false
private bool TestMe()
{
testClass tc1 = new testClass("abc", "def", "ghi");
testClass tc2 = new testClass("123", "456", "789");
testClass tc3 = new testClass("xxx", "yyy", "zzz");
testClass tc4 = new testClass("abc", "def", "ghi");
ArrayList array1 = new ArrayList();
array1.Add(tc1);
array1.Add(tc2);
array1.Add(tc3);
return array1.Contains(tc4);
}
The code above uses the following class
internal class testClass
{
public string abc;
public string def;
public string ghi;
public testClass(string abc, string def, string ghi)
{
this.abc = abc;
this.def = def;
this.ghi = ghi;
}
}
But interestingly this returns true
private void TestMe2()
{
string tc1 = "abc";
string tc2 = "123";
string tc3 = "xxx";
string tc4 = "abc";
ArrayList array1 = new ArrayList();
array1.Add(tc1);
array1.Add(tc2);
array1.Add(tc3);
return array1.Contains(tc4);
}
I assume that it works with basic types but not anything custom
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
use this test class and it will work:
internal class testClass
{
public string abc;
public string def;
public string ghi;´
public testClass(string abc, string def, string ghi)
{
this.abc = abc;
this.def = def,
this.ghi = ghi;
}
public override bool Equals(object obj)
{
testClass t = obj as testClass;
if (t == null) return false;
return t.abc == this.abc && t.def == this.def && t.ghi == this.ghi;
}
}
|
|
|
|
|
Thats great it works a treat.
But one small question, when I implement the override Visual Studio gives me the following warning :
c:\_development\csharp\containstest\form1.cs(131,18): warning CS0659: 'ContainsTest.Form1.testClass' overrides Object.Equals(object o) but does not override Object.GetHashCode()
If I put in the default override for GetHashCode(), the warning is no longer shown :
public override int GetHashCode()
{
return base.GetHashCode ();
}
Why does VS need that default override?
Also would it be possible to somehow manipulate the override so that it performs case insensitive searches based on the value of a boolean parameter?
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
The reason for the warning from the compiler is simple, when two objects return true from the .Equals override, they should always return the same hashcode... in essence equality and equal hashes go hand in hand. Also, when overriding .Equals it is good practice to override the == and != operator.
for case-insensitive it should be pretty easy:
public override bool Equals(object obj)
{
testClass t = obj as testClass;
if (t == null) return false;
return t.abc.toLower() == this.abc.toLower() && t.def.toLower() == this.def.toLower() && t.ghi.toLower() == this.ghi.toLower();
}
Another way is to use a CaseInsensitiveComparer , which im sure can be found easily on MSDN.
|
|
|
|
|
My problem relates to the code below, and I cant understand why its happening. I have to use the int test as the values I declared do not work. If you add a watch to guid, amount or serial, the watch value says that these are out of scope, and as such, nothing is assigned to them. If however I add in the int test, and assign it (as shown below), the program works. Any ideas?
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs);
string guid = "a";
int amount = 1;
byte[] serial = {1};
int test;
test = guid.Length;
test = amount;
test = serial.Length;
amount = r.ReadInt32();
guid = r.ReadString();
serial = r.ReadBytes(32);
r.Close();
fs.Close();
|
|
|
|
|
didn't understand
toticow wrote:
If you add a watch to guid, amount or serial, the watch value says that these are out of scope
when are they out of scope? after u've assigned them, without the int test ?
there are no facts, only interpretations
|
|
|
|
|
I a list view control before removing item(s) I am prompting the user with a message box "if he really wants to delete the item(s)". If the answer is "YES" then the item(s) are removed. when the answer is "NO" then the item(s) are not removed as it should be; but the selected item(s) are not displayed as selected that is hot items with rectacle showing the selection effect. How to show that rectangle?
In another way is to send the LVM_SETHOTITEM message which will show the items as selected. But I don't know how to send a message in C#
|
|
|
|
|
eDip wrote:
In another way is to send the LVM_SETHOTITEM message which will show the items as selected. But I don't know how to send a message in C#
Try the following:
int LVM_SETHOTITEM = 0x103C;
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, IntPtr lParam);
SendMessage(lvwCtrl.Handle, LVM_SETHOTITEM, index - 1, 0);
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi guys,
I want to ask how to call an external app from C# (a command like Shell command in VB.Net or ShellExcute in VC++).
Thank your.
|
|
|
|
|