|
Hi,
the machine hardware configuration that i need to install my software on it, consist one ethernet port indispensable and maybe one wireless adaptor (wireless is optional).
|
|
|
|
|
When you retrieve the MAC address, it will get the MAC address of the NIC that's currently active, or the first one in the list if they're both active. And once again, what if both NICs are disabled? Then you can't get a MAC address at all.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
The way that I received it was by running ipconfig.exe and redirecting the output to your application through the System.Diagnostic.Process class. Then I just wrote code to manipulate the input to get the MAC address I want.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I have a very simple Windows form in C# with one pictureBox and two textBoxes. The form is a MdiChild . When the form loads I want the focus to go to textBox1. I have set the TabStop property to True and the TabIndex to 0, but it didn't work. I have tried:
textBox1.Focus();
and
textBox1.Select();
in both the Form_Load and Form_Activated event handlers, but these have not worked. If I use either of these methods in the pictureBox_Click event handler they work fine!
Can anybody help please?
|
|
|
|
|
Try both at the same time
|
|
|
|
|
I have just tried that, but it didn't help
|
|
|
|
|
no probs..try to set TabIndex paroperty of textboxes..0(fisrt textbox),1....
it will works properly...because i tried i got functionality,,whatever u want...
|
|
|
|
|
Richard W Allen wrote: in both the Form_Load and Form_Activated event handlers
Try the Form_Shown event handler.
Kristian Sixhoej
"You can't undo the past... but you can certainly not repeat it." - Bruce Willis
|
|
|
|
|
Kristian Sixhoej wrote: Try the Form_Shown event handler.
That works a treat! Many thanks.
|
|
|
|
|
You're welcome.
Kristian Sixhoej
"You can't undo the past... but you can certainly not repeat it." - Bruce Willis
|
|
|
|
|
hi every body
i have desktop application
i want to get the copied files names from windows to my application
ex:
the user will copy any file from pc and i have button in my form i want when user click this button the name of files which he copied it appear in list box
how can i do this ??
thanks in advance
|
|
|
|
|
Hi,
there is a class called System.IO.FileSystemWatcher. Using this class you can observe file actions on directory or file. If a file is copied the FileSystemWatcher will throw the event OnCreated. Problem is that you don't know if it is a newly created file or a copied file... but maybe it is a good point to start.
Regards
Sebastian
|
|
|
|
|
thanks for reply baut file system watcher i must give it one directory to watch it
i want get the name of the files on any where on computer
thanks again for reply
|
|
|
|
|
Okay, well, but isn't your drive a directory?
|
|
|
|
|
Watching an entire drive is not a good idea. The FSW starts to perform badly the more you have it watch.
He really doesn't have a solution to use since there is nothing that signals "Hey, there's a copy going on!".
|
|
|
|
|
The FSW, as bad as it is, is the only solution you have. There is no event or any signal that says there is a copy operation going on.
|
|
|
|
|
Hi Folks,
I made one prog with C# to list some query in a listbox control, and I want it to be saved to a file like *.txt or *.csv or ... anyway I just want to save my listbox content but I don't know how if someone can give me some tips.
thanks in advance for all and have a nice day.
|
|
|
|
|
|
Thanks for your reply but it does not what I expect to have. Maybe my question is not quiet clear so I'll explain first what I want to have.
So I have one listbox that I populate with a result of a calculation. Let's say the listbox contains 100 items.
What I need is to save those list items into a file (maybe I want them later even if I already closed the program for another process).
What you showed me is just the way how to write into a file but not how to retrieve all value of the list and save them into a file.
This is what I want.
But, fortunately, I know now how to save the listbox contents :
1. I count the number of items : listbox1.Items.Count;
2. recursively set each Items selected : listbox1.SetSelected(i, true);
and StreamWriter each selected Items directly.
for example :
int number = listbox1.Items.Count;
StreamWriter sw = new StreamWriter(@"C:\list.csv");
for (int i = 0; i < number; i++)
{
listbox1.SetSelected(i, true);
sw.WriteLine(listbox1.SelectedItems[i].ToString());
}
sw.Close();
Hope this will help someone else. (of course you can personalize it like adding savefiledialog...)
Cheers,
|
|
|
|
|
|
Hi, i have wrote a code to connect to FTP. But once connected, a DISCONNECT button will show. And when i click it, i wan it to end the connection.
CONNECT CODE
public bool Connect()
{
bool success = false;
try
{
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + tbxServerAddress.Text + "/"));
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(tbxUsername.Text, tbxPassword.Text);
reqFTP.Method = WebRequestMethods.Ftp.PrintWorkingDirectory;
WebResponse response = reqFTP.GetResponse();
if (response !=null)
{
success = true;
}
else
{
success = false;
}
}
catch (Exception ex)
{
MessageBox.Show("Error : Invalid User or Pass");
}
return success;
}
Btw am i coding the connect code the right way?
And how do i code the DISCONNECT method
|
|
|
|
|
|
It doesnt have the finalize method
btw when i upload a file, how do i use the current connection to upload instead of creating a new connection
|
|
|
|
|
|
but i cant use it.. it says
Finalize is protected and, therefore, is accessible only through this class or a derived class.
|
|
|
|