Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
AnswerRe: 3D C# windows from Pin
Amir Mohammad Nasrollahi29-Jul-13 22:27
professionalAmir Mohammad Nasrollahi29-Jul-13 22:27 
QuestionStoring folderBrowser.SelectedPath in a String Variable Pin
ASPnoob7-Feb-13 23:56
ASPnoob7-Feb-13 23:56 
AnswerMessage Closed Pin
8-Feb-13 0:00
mveCHill608-Feb-13 0:00 
NewsRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Eddy Vluggen8-Feb-13 0:28
professionalEddy Vluggen8-Feb-13 0:28 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Dave Kreskowiak8-Feb-13 2:35
mveDave Kreskowiak8-Feb-13 2:35 
AnswerRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Eddy Vluggen8-Feb-13 0:29
professionalEddy Vluggen8-Feb-13 0:29 
AnswerRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Dave Kreskowiak8-Feb-13 2:45
mveDave Kreskowiak8-Feb-13 2:45 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
ASPnoob8-Feb-13 7:28
ASPnoob8-Feb-13 7: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 8:39
professionalMatt T Heffron8-Feb-13 8:39 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
Dave Kreskowiak8-Feb-13 8:39
mveDave Kreskowiak8-Feb-13 8:39 
GeneralRe: Storing folderBrowser.SelectedPath in a String Variable Pin
ASPnoob8-Feb-13 11:06
ASPnoob8-Feb-13 11:06 
QuestionAndroid & .NET Pin
thebakkal7-Feb-13 14:39
thebakkal7-Feb-13 14:39 
AnswerRe: Android & .NET Pin
Keith Barrow7-Feb-13 23:21
professionalKeith Barrow7-Feb-13 23:21 
QuestionAndroid & .NET Pin
thebakkal7-Feb-13 14:37
thebakkal7-Feb-13 14:37 
AnswerRe: Android & .NET Pin
Jibesh7-Feb-13 14:47
professionalJibesh7-Feb-13 14:47 
AnswerRe: Android & .NET Pin
Bernhard Hiller7-Feb-13 22:47
Bernhard Hiller7-Feb-13 22:47 
AnswerRe: Android & .NET Pin
Pete O'Hanlon7-Feb-13 22:59
mvePete O'Hanlon7-Feb-13 22:59 
JokeRe: Android & .NET Pin
Wayne Gaylard7-Feb-13 23:24
professionalWayne Gaylard7-Feb-13 23:24 
QuestionChech if a graph is connected Pin
brkonja7-Feb-13 10:27
brkonja7-Feb-13 10:27 
AnswerRe: Chech if a graph is connected Pin
Super Lloyd7-Feb-13 15:03
Super Lloyd7-Feb-13 15:03 
QuestionC# debug windows Pin
classy_dog7-Feb-13 9:14
classy_dog7-Feb-13 9:14 
AnswerRe: C# debug windows Pin
Jibesh7-Feb-13 13:34
professionalJibesh7-Feb-13 13:34 
AnswerRe: C# debug windows Pin
Eddy Vluggen8-Feb-13 0:31
professionalEddy Vluggen8-Feb-13 0:31 
QuestionXelement headers and schema definition quandry Pin
DJ 27-Feb-13 4:34
DJ 27-Feb-13 4:34 
AnswerRe: Xelement headers and schema definition quandry Pin
Matt T Heffron7-Feb-13 8:00
professionalMatt T Heffron7-Feb-13 8: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.