¡@

Home 

c# Programming Glossary: safefilehandle

Insert bytes into middle of a file (in windows filesystem) without reading entire file (using File Allocation Table)?

http://stackoverflow.com/questions/13430210/insert-bytes-into-middle-of-a-file-in-windows-filesystem-without-reading-entir

SetLastError true CharSet CharSet.Auto static extern SafeFileHandle CreateFile string lpFileName MarshalAs UnmanagedType.U4 FileAccess.. SetLastError true public static extern bool ReadFile SafeFileHandle hFile handle to file byte pBuffer data buffer should be fixed.. CharSet.Auto public static extern bool SetFilePointerEx SafeFileHandle hFile long liDistanceToMove out long lpNewFilePointer SeekOrigin..

IO exception error when using serialport.open()

http://stackoverflow.com/questions/14885288/io-exception-error-when-using-serialport-open

14 private const int CommStateRetries 10 private SafeFileHandle m_Handle private SerialPortFixer string portName const int.. throw new ArgumentException Invalid Serial Port portName SafeFileHandle hFile CreateFile @ . portName dwAccess 0 IntPtr.Zero 3 dwFlagsAndAttributes.. SetLastError true private static extern bool GetCommState SafeFileHandle hFile ref Dcb lpDcb DllImport kernel32.dll CharSet CharSet.Auto..

Physical disk size not correct (IoCtlDiskGetDriveGeometry)

http://stackoverflow.com/questions/15051660/physical-disk-size-not-correct-ioctldiskgetdrivegeometry

true CharSet CharSet.Auto public static extern SafeFileHandle CreateFile string fileName uint fileAccess uint fileShare IntPtr.. CharSet.Auto public static extern int DeviceIoControl SafeFileHandle device uint controlCode IntPtr inBuffer uint inBufferSize IntPtr.. IoCtlDiskGetDriveGeometry 0x70000 public static void Main SafeFileHandle diskHandle NativeMethods.CreateFile @ . PhysicalDrive0 NativeMethods.FileAccessGenericRead..

.NET code to send ZPL to Zebra printers

http://stackoverflow.com/questions/2044676/net-code-to-send-zpl-to-zebra-printers

DllImport kernel32.dll SetLastError true static extern SafeFileHandle CreateFile string lpFileName FileAccess dwDesiredAccess uint.. the CreateFile external func to connect to the LPT1 port SafeFileHandle printer CreateFile LPT1 FileAccess.ReadWrite 0 IntPtr.Zero FileMode.Open..

Should you declare methods using overloads or optional parameters in C# 4.0?

http://stackoverflow.com/questions/251868/should-you-declare-methods-using-overloads-or-optional-parameters-in-c-sharp-4-0

from a string the ones from an IntPtr and the ones from a SafeFileHandle . FileStream string FileMode FileStream string FileMode FileAccess..

How can I write fast colored output to Console?

http://stackoverflow.com/questions/2754518/how-can-i-write-fast-colored-output-to-console

SetLastError true CharSet CharSet.Auto static extern SafeFileHandle CreateFile string fileName MarshalAs UnmanagedType.U4 uint fileAccess.. SetLastError true static extern bool WriteConsoleOutput SafeFileHandle hConsoleOutput CharInfo lpBuffer Coord dwBufferSize Coord dwBufferCoord.. public short Bottom STAThread static void Main string args SafeFileHandle h CreateFile CONOUT 0x40000000 2 IntPtr.Zero FileMode.Open 0..

How to parse a text file in C# and be io bound?

http://stackoverflow.com/questions/7153315/how-to-parse-a-text-file-in-c-sharp-and-be-io-bound

fixed byte pBuf buf 0 uint dwRead 0 if ReadFile stream.SafeFileHandle pBuf 200 1000 1000 out dwRead IntPtr.Zero 0 throw new Win32Exception.. SetLastError true unsafe static extern uint ReadFile SafeFileHandle hFile Out byte lpBuffer uint nNumberOfBytesToRead out uint lpNumberOfBytesRead..