I am just adding this function so that others can use it if needed...
public static void WriteToFile(IntPtr iPtr,int size,string sFileName)
{
if(sFileName.Trim().Length == 0)
sFileName =
;
Byte[] Contents = new Byte[size];
Marshal.Copy(iPtr, Contents, 0, size);
System.IO.FileStream fs = new System.IO.FileStream(sFileName , System.IO.FileMode.Create);
foreach (Byte bt in Contents)
fs.WriteByte(bt);
fs.Flush();
fs.Close();
}
|