Pregunta

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#

¿Fue útil?

Solución

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

Otros consejos

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");
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top