Click here to Skip to main content
15,509,916 members
Home / Discussions / C#
   

C#

 
AnswerRe: 3D C# windows from Pin
Amir Mohammad Nasrollahi29-Jul-13 23:27
professionalAmir Mohammad Nasrollahi29-Jul-13 23:27 
QuestionStoring folderBrowser.SelectedPath in a String Variable Pin
ASPnoob8-Feb-13 0:56
ASPnoob8-Feb-13 0:56 
AnswerMessage Closed Pin
8-Feb-13 1:00
mveCHill608-Feb-13 1:00 
NewsRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Eddy Vluggen8-Feb-13 1:28
professionalEddy Vluggen8-Feb-13 1:28 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Dave Kreskowiak8-Feb-13 3:35
mveDave Kreskowiak8-Feb-13 3:35 
AnswerRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Eddy Vluggen8-Feb-13 1:29
professionalEddy Vluggen8-Feb-13 1:29 
AnswerRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Dave Kreskowiak8-Feb-13 3:45
mveDave Kreskowiak8-Feb-13 3:45 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
ASPnoob8-Feb-13 8:28
ASPnoob8-Feb-13 8:28 
Thank you all for replying. The following is my code for creating a text file in a folder after browsing to it:
C#
string myFolderPath = folderBrowserDialog1.SelectedPath;

           string myFileName = txtFileName.Text.ToString();
           if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
           {
               TextWriter myWriter = File.CreateText(myFolderPath + @"\" + myFileName + ".txt");
               myWriter.Write("Hello World");
               myWriter.Close();

           }


The "UnauthorizedAccessException was unhandled" exception was thrown and I get the error message "Access to the path 'C:\MyTestFile' is denied" when I run the code above. It works fine if I use folderBrowserDialog1.SelectedPath in place of myFolderPath.
AnswerRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Matt T Heffron8-Feb-13 9:39
professionalMatt T Heffron8-Feb-13 9:39 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Dave Kreskowiak8-Feb-13 9:39
mveDave Kreskowiak8-Feb-13 9:39 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
ASPnoob8-Feb-13 12:06
ASPnoob8-Feb-13 12:06 
QuestionAndroid & .NET Pin
thebakkal7-Feb-13 15:39
thebakkal7-Feb-13 15:39 
AnswerRe: Android & .NET Pin
Keith Barrow8-Feb-13 0:21
professionalKeith Barrow8-Feb-13 0:21 
QuestionAndroid & .NET Pin
thebakkal7-Feb-13 15:37
thebakkal7-Feb-13 15:37 
AnswerRe: Android & .NET Pin
Jibesh7-Feb-13 15:47
professionalJibesh7-Feb-13 15:47 
AnswerRe: Android & .NET Pin
Bernhard Hiller7-Feb-13 23:47
Bernhard Hiller7-Feb-13 23:47 
AnswerRe: Android & .NET Pin
Pete O'Hanlon7-Feb-13 23:59
mvaPete O'Hanlon7-Feb-13 23:59 
JokeRe: Android & .NET Pin
Wayne Gaylard8-Feb-13 0:24
professionalWayne Gaylard8-Feb-13 0:24 
QuestionChech if a graph is connected Pin
brkonja7-Feb-13 11:27
brkonja7-Feb-13 11:27 
AnswerRe: Chech if a graph is connected Pin
Super Lloyd7-Feb-13 16:03
Super Lloyd7-Feb-13 16:03 
QuestionC# debug windows Pin
classy_dog7-Feb-13 10:14
classy_dog7-Feb-13 10:14 
AnswerRe: C# debug windows Pin
Jibesh7-Feb-13 14:34
professionalJibesh7-Feb-13 14:34 
AnswerRe: C# debug windows Pin
Eddy Vluggen8-Feb-13 1:31
professionalEddy Vluggen8-Feb-13 1:31 
QuestionXelement headers and schema definition quandry Pin
DJ 27-Feb-13 5:34
DJ 27-Feb-13 5:34 
AnswerRe: Xelement headers and schema definition quandry Pin
Matt T Heffron7-Feb-13 9:00
professionalMatt T Heffron7-Feb-13 9:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.