Вопрос

I read this commands in c++ language

FILE * fp;
BYTE r,g,b;
fp=fopen(fn,"rb");
fread((BYTE * )&b,sizeof(BYTE),1,fp);

I am Bigeneer in c# ,what is similar commands in c# langugehow can I use pointer (BYTE * )&b in c#

Это было полезно?

Решение

You can use FileStream object for File operations and for opening the file you can use File.Open instead of fOpen

Другие советы

You can use this for all lines :

using system.IO;

string[] mylines = System.IO.File.ReadAllLines(@"myfile.txt");

Or this for one line :

  string mytext = System.IO.File.ReadAllText(@"myfile.txt");
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top