# [.net] .NET Direct Disk Access

This topic is 3727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does .NET provide any APIs for direct disk access? For example, writing raw sectors onto a floppy disk? I kind of doubt that it allows for this kind of low-level access, but I thought I would check. I couldn't find anything in MSDN.

##### Share on other sites
Not likely. You'll probably be PInvoking to Win32 -- or even raw NT syscalls -- for this one.

Dim fs As System.IO.FileStream = New system.IO.FileStream("\\.\PhysicalDriveN",IO.FileMode.Open,IO.FileAccess.ReadWrite)Dim bw As New System.IO.BinaryWriter(fs)' Do work herebw.Flush()bw.Close()fs.Close()