question

bobuckman-8186 avatar image
0 Votes"
bobuckman-8186 asked Viorel-1 answered

How do you get a files path using C++/CLI?

Yo. VC++ noob here. I was wondering how I could get a files path using C++/CLI. The file is defined in a variable but I don't see a property for path or location.

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

Viorel-1 avatar image
1 Vote"
Viorel-1 answered

Check an example:

 using namespace System::IO;
    
 String^ example = R"(C:\My Folders\Folder1\File1.txt)";
    
 String^ path = Path::GetDirectoryName( example ); 
    
 // result: "C:\My Folders\Folder1"


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.