//search all floppy,cd and hard disk drives available in our PC
//its varies from system to system
for(char Ch='A';Ch<='Z';Ch++) { string Dir = Ch + @":\"; if (Directory.Exists(Dir)) {
disksListBox.Items.Add( Ch+ @":" ); //Add into ListBox
}
}
SEARCH ALL FLOPPY,CD AND HARD DISK DRIVES
Posted by
Geeks
Labels:
C#
Tuesday, September 04, 2007 | 0 Comments
COPY AND PASTE THE DATA USING CLIPBOARD
Posted by
Geeks
Labels:
C#
//copy the data using Clipboard
Clipboard.SetDataObject(textBox1.SelectedText,true);
//paste the data using Clipboard
IDataObject iData = Clipboard.GetDataObject();
//Determine whether the data is in a format you can use.
if(iData.GetDataPresent(DataFormats.Text))
{
textBox1.SelectedText =(String)iData.GetData(DataFormats.Text); //display it in a text box.
}
Tuesday, September 04, 2007 | 0 Comments
GET THE USER NAME IN C# FOR NT AUTHENTICATION
Posted by
Geeks
Labels:
C#
//Declare the Header File
using System.Security.Principal;
string a;
a=System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
//Above Statement,opens us up to more than just the current user.
MessageBox.Show(a.ToString());
Monday, September 03, 2007 | 0 Comments
Subscribe to:
Posts (Atom)