question

bobuckman-8186 avatar image
0 Votes"
bobuckman-8186 asked Castorix31 commented

How do you open a file using C++/CLI?

Hello, I was wondering how you can open a text file using C++/CLI. I already created the file variable but I got stuck on how to open it.

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 commented

I was wondering how you can open a text file using C++/CLI.

A simple way :

 String^ sText = System::IO::File::ReadAllText("E:\\test.txt");
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yeah. But how do you use File::Open()?

0 Votes 0 ·

See the samples in the MSDN documentation, like :
Read a Text File


0 Votes 0 ·

Hello, seems I got this error. 137036-image.png




0 Votes 0 ·
image.png (5.2 KiB)
Show more comments