3,972 questions
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"
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
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"