VB.NET 2008, Windows 7 and saving files -


We have to learn VB.NET for semester, my experience primarily happens with C # - it is not that Difference between This is a special problem.

I used the simplest way to protect the file from using NAT framework, but Windows 7 will not save the file anywhere (or anywhere I will still get it). Here is a code that I am using to save a text file. FolderBrowserDialog = New Folder Browser Dialog () as Dial Dialog () dim Save as the Location string = Dialog ... Selective Path ... Make Output String ... Try Trying File 'Try' My.Computer.FileSystem.WriteAllText (saveLocation, Output, False) does not have permission to save the file in the specified folder. MessageBox.Show (saveLocation, Output, False) is not permitted to save X. 'We have no permission to save this folder in the form of unauthorized access. please Try to save it from the wrong. "," Error ", MessageBoxButtons.OK, MessageBoxIcon.Error). Pre-Hold As Exception 'Write any file to hold exception. MessageBox.Show (" File Writing was Not Successful. "," Error Try, MessageBoxButtons.OK, MessageBoxIcon.Error)

The problem is that there is no unauthorized access access using this code, where I try to save the file Attempted to run .exe file as administrator, and the form of administrator Switch to the IDE.

Is it just Windows 7 susceptible? And if so, what can I do to solve this problem? Describe the requirements that I can save a file!

Thank you.

This code:

browser as dialog () Dim Save as the Location string = Dialog. Selected path

You are placing Folder . You are then trying to save the file as a folder of the same name instead, I believe that you want to save the file inside :

  string = dialog as a slow selection. Save the selected path: Place = path.comben (saving location, "some file .txt")  

This will create a file named "SomeFile.txt" inside the selected folder.

Alternatively, instead of using FolderBrowserDialog to select a folder, use the actual file instead.


Comments