2

I have an application written in C# WPF, and saving a generated Word document. Through the RemoteApp settings, I've set to show the local user's logical drives, but they don't have letters next to them. They show up as C on myHostname, D on myHostname, etc.

When I open up a SaveFileDialog object, it shows Local Disk (C:), C on myHostname, and D on myHostname in the left-hand pane.

How do I set the filename, if there's no corresponding letter?

string filename = @"C:\myDirectory\myFile.docx";
using(WordprocessingDocument myDoc =
    WordprocessingDocument.Create(filename, 
        WordprocessingDocumentType.Document)) {}
Bob.
  • 3,894
  • 4
  • 44
  • 76

1 Answers1

2

I found that if I'm using Terminal Services Client, I can use the keyword tsclient to tell it to use the local user's drives.

// Check if remote session, and get the local drive location
if(System.Windows.Forms.SystemInformation.TerminalServerSession) {
    filename = @"\\tsclient\C\myDirectory\myFile.docx";
}
Bob.
  • 3,894
  • 4
  • 44
  • 76