我在VB.Net
中有以下内容
ReadFile(HidDevice, ReadBuffer(0), (long)(Capabilities.InputReportByteLength), NumberOfBytesToRead, 0);
想知道C#中的等效方法是什么?
using (System.IO.StreamReader streamReader = new System.IO.StreamReader("file location"))
{
string content = streamReader.ReadToEnd();
}
或
using (System.IO.FileStream fileStream = new System.IO.FileStream("file location", System.IO.FileMode.Open))
{
byte[] content = new byte[fileStream.Length];
fileStream.Read(content, 0, content.Length);
}