c# Programming Glossary: fs.seek
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 FileAccess.Read BinaryReader br new BinaryReader fs fs.Seek 0x3c SeekOrigin.Begin Int32 peOffset br.ReadInt32 fs.Seek peOffset.. fs.Seek 0x3c SeekOrigin.Begin Int32 peOffset br.ReadInt32 fs.Seek peOffset SeekOrigin.Begin UInt32 peHead br.ReadUInt32 if peHead..
Creating a Huge Dummy File in a Matter of Seconds in C# http://stackoverflow.com/questions/1881050/creating-a-huge-dummy-file-in-a-matter-of-seconds-in-c-sharp new FileStream @ c tmp huge_dummy_file FileMode.CreateNew fs.Seek 2048L 1024 1024 SeekOrigin.Begin fs.WriteByte 0 fs.Close This..
c#: how to read parts of a file? (DICOM) http://stackoverflow.com/questions/2381983/c-how-to-read-parts-of-a-file-dicom filename using FileStream fs File.OpenRead filename fs.Seek 128 SeekOrigin.Begin if fs.ReadByte byte 'D' fs.ReadByte byte..
Get last 10 lines of very large text file > 10GB c# http://stackoverflow.com/questions/398378/get-last-10-lines-of-very-large-text-file-10gb-c-sharp sizeOfChar position endPosition position sizeOfChar fs.Seek position SeekOrigin.End fs.Read buffer 0 buffer.Length if encoding.GetString.. where number of tokens in file is less than numberOfTokens fs.Seek 0 SeekOrigin.Begin buffer new byte fs.Length fs.Read buffer..
Using FileStream.Seek http://stackoverflow.com/questions/5201414/using-filestream-seek lineNo in lineNos position lineNo 1 LineLength position fs.Seek position SeekOrigin.Current if line reader.ReadLine null .. int lineNo in lineNoArray position lineNo 1 LineLength fs.Seek position SeekOrigin.Begin if line reader.ReadLine null PrintLine.. in lineNoArray position lineNo oldLineNo 1 LineLength fs.Seek position SeekOrigin.Current line ReadLine fs LineLength PrintLine..
StreamReader and seeking http://stackoverflow.com/questions/5404267/streamreader-and-seeking while sr.EndOfStream Debug.WriteLine sr.ReadLine fs.Seek pos SeekOrigin.Begin Debug.WriteLine sr.ReadLine Prints Nothing..
calculate sending file speed/sec by taking the average of 5 times of sent bytes http://stackoverflow.com/questions/9030297/calculate-sending-file-speed-sec-by-taking-the-average-of-5-times-of-sent-bytes new Thread fP.clock thClock.Start while sum fileSize fs.Seek sum SeekOrigin.Begin fs.Read fileData 0 fileData.Length count..
|