Hallo zusammen,
ich möchte gerne mit explorer eine versteckte Freigabe von einem Remote-PC öffnen. Es funktioniert irgendwie nicht, weil das Backslash \ zweimal vorkommt!
string path = "\\RemotePC\\C$";
Process.Start("explorer.exe", path);
Ich habe auch so probiert, aber ohne Erfolg:
string path = @"\\RemotePC\\C$";
Process.Start("explorer.exe", path);
Die Variable path sollte eigentlich so aussehen: \RemotePC\C$ und NICHT so: \RemotePC\C$
Wie bekomme ich nur ein Backslash vordem C$ hin?
Danke.
So funktioniert es bei mir problemlos:
string path = @"\\RemotePC\c$";
Process.Start("explorer.exe", path);
Beachte den einzelnen Backslash vor dem c$
Hallo csharp-user,
siehe auch [FAQ] Was bedeutet das @ (=at) vor String-Literalen? Und: Wissenswertes zu Escape-Sequenzen
Gruss
Coffeebean
Microsoft MVP // Me // Blog // GitHub // @Egghead // All my talks // Speakerdeck