1
Answer

Save file to drive based on drive name

sop wyin

sop wyin

13y
2.4k
1

We should all know how to save a text file like so:         

richTextBox1.SaveFile(@"C:\hello.txt", RichTextBoxStreamType.PlainText);

 

But I want to save it to an external drive. So I would try:

            richTextBox1.SaveFile(@"F:\hello.txt", RichTextBoxStreamType.PlainText);

 

BUT, F: can change to G: or E:, etc...  F: usually has a name such as 'SD Card', though. 

 

So how do I save to the Removable Disk 'SD Card' based on it's name?

Answers (1)