c# Programming Glossary: fileaccess.read
check if unmanaged dll is 32-bit or 64-bit? http://stackoverflow.com/questions/1001404/check-if-unmanaged-dll-is-32-bit-or-64-bit enum FileStream fs new FileStream dllPath FileMode.Open FileAccess.Read BinaryReader br new BinaryReader fs fs.Seek 0x3c SeekOrigin.Begin..
What is AsyncCallback? http://stackoverflow.com/questions/1047662/what-is-asynccallback FileStream strm new FileStream filename FileMode.Open FileAccess.Read FileShare.Read 1024 FileOptions.Asynchronous Make the asynchronous..
A C# equivalent of C's fread file i/o http://stackoverflow.com/questions/1935851/a-c-sharp-equivalent-of-cs-fread-file-i-o var stream new FileStream @ c temp test.bin FileMode.Open FileAccess.Read while stream.Position stream.Length data.Add reader.Read stream..
How can I determine for which platform an executable is compiled? http://stackoverflow.com/questions/197951/how-can-i-determine-for-which-platform-an-executable-is-compiled 4096 using Stream s new FileStream fileName FileMode.Open FileAccess.Read s.Read data 0 4096 dos header is 64 bytes last element long..
Possible to calculate MD5 (or other) hash with buffered reads? http://stackoverflow.com/questions/2124468/possible-to-calculate-md5-or-other-hash-with-buffered-reads FileStream fs new FileStream file FileMode.Open FileAccess.Read byte hash ha.ComputeHash fs fs.Close return hash However the..
How do I create an MD5 hash digest from a text file? http://stackoverflow.com/questions/2150455/how-do-i-create-an-md5-hash-digest-from-a-text-file using FileStream fs new FileStream filePath FileMode.Open FileAccess.Read FileShare.Read return HashFile fs public string HashFile FileStream..
Reading large text files with streams in C# http://stackoverflow.com/questions/2161895/reading-large-text-files-with-streams-in-c-sharp like this using FileStream fs File.Open path FileMode.Open FileAccess.Read FileShare.ReadWrite using BufferedStream bs new BufferedStream..
How to force ADO.Net to use only the System.String DataType in the readers TableSchema http://stackoverflow.com/questions/2567673/how-to-force-ado-net-to-use-only-the-system-string-datatype-in-the-readers-table using var fileStream new FileStream path FileMode.Open FileAccess.Read using var excelReader ExcelReaderFactory.CreateOpenXmlReader..
How to determine whether a DLL is a managed assembly or native (prevent loading a native dll)? http://stackoverflow.com/questions/367761/how-to-determine-whether-a-dll-is-a-managed-assembly-or-native-prevent-loading uint 16 Stream fs new FileStream fileName FileMode.Open FileAccess.Read BinaryReader reader new BinaryReader fs PE Header starts @ 0x3C..
How do you read a file which is in use? http://stackoverflow.com/questions/3709104/how-do-you-read-a-file-which-is-in-use FileStream stream File.Open path to file FileMode.Open FileAccess.Read FileShare.ReadWrite using StreamReader reader new StreamReader..
simultaneous read-write a file in C# http://stackoverflow.com/questions/3817477/simultaneous-read-write-a-file-in-c-sharp test System.IO.FileMode.OpenOrCreate System.IO.FileAccess.ReadWrite var sw new System.IO.StreamWriter fs var sr new System.IO.StreamReader.. var iStream new FileStream test FileMode.Open FileAccess.Read FileShare.ReadWrite var sw new System.IO.StreamWriter oStream..
Insert blob in oracle database with C# http://stackoverflow.com/questions/4902250/insert-blob-in-oracle-database-with-c-sharp file FileStream fs new FileStream SourceLoc FileMode.Open FileAccess.Read Create a byte array of file stream length byte ImageData new..
Serialize Class containing Dictionary member http://stackoverflow.com/questions/495647/serialize-class-containing-dictionary-member var filestream File.Open filename FileMode.OpenOrCreate FileAccess.ReadWrite try var serializer new XmlSerializer typeof ConfigFile.. using var filestream File.Open filename FileMode.Open FileAccess.Read try var serializer new XmlSerializer typeof ConfigFile return..
Extracting files from a Zip archive programmatically using C# and System.IO.Packaging http://stackoverflow.com/questions/507751/extracting-files-from-a-zip-archive-programmatically-using-c-sharp-and-system-io ZipPackage Package.Open @ .. .. test.zip FileMode.Open FileAccess.Read PackagePartCollection packageParts package.GetParts foreach..
Generate a PDF that automatically prints http://stackoverflow.com/questions/6167995/generate-a-pdf-that-automatically-prints new System.IO.FileStream test_input.pdf FileMode.Open FileAccess.Read FileShare.Read IacDocument document new IacDocument null if..
open file in exclusive mode in C# http://stackoverflow.com/questions/685135/open-file-in-exclusive-mode-in-c-sharp Stream iStream File.Open c software code.txt FileMode.Open FileAccess.Read FileShare.None Console.WriteLine I am here return c# file..
File access error with FileSystemWatcher when multiple files are added to a directory http://stackoverflow.com/questions/699538/file-access-error-with-filesystemwatcher-when-multiple-files-are-added-to-a-dire FileStream fs new FileStream e.FullPath FileMode.Open FileAccess.Read FileShare.None using StreamReader sr new StreamReader fs while.. Stream stream System.IO.File.Open fileName FileMode.Open FileAccess.ReadWrite FileShare.ReadWrite if stream null System.Diagnostics.Trace.WriteLine..
Save and load MemoryStream to/from a file http://stackoverflow.com/questions/8624071/save-and-load-memorystream-to-from-a-file FileStream file new FileStream file.bin FileMode.Open FileAccess.Read byte bytes new byte file.Length file.Read bytes 0 int file.Length..
How do I determine the HResult for a System.IO.IOException? http://stackoverflow.com/questions/991537/how-do-i-determine-the-hresult-for-a-system-io-ioexception opens and reads files on a system. I open the file with FileAccess.Read and FileShare.ReadWrite according to this guidance because I..
|