Namespaces :-
System.Drawing;
Coding :-
byte[] bytArray;
Bitmap bImg = new Bitmap(Server.MapPath(path));
ImageConverter imgCon = new ImageConverter();
bytArray = (byte[])imgCon.ConvertTo(bImg , typeof(byte[]));
CONVERT IMAGE TO BYTE USING ASP.NET
Saturday, November 03, 2007 | 0 Comments
SEARCH ALL FLOPPY,CD AND HARD DISK DRIVES
//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
}
}
Tuesday, September 04, 2007 | 0 Comments
COPY AND PASTE THE DATA USING CLIPBOARD
//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
//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
WRITE THE DATA INTO FILE
using(StreamWriter sr=new StreamWriter("F:\\out.txt"))
{
sw.write("Have a nice day");
Response.write("saved");
}
Sunday, September 02, 2007 | 0 Comments
READ THE DATA FROM FILE
using(StreamReader sr=new StreamReader("h:\\appl.txt"))
{
while(sr.ReadLine()!=null)
{
string s;
s=sr.ReadLine();
ListBox1.Items.Add(s);
}
}
Sunday, September 02, 2007 | 0 Comments