I'm puttint a program on my work's intranet that I would like everyone in my group to use. However I am running into a problem that doesn't seem to make sense.
The way it is supposed to work is that you click a browse button and it opens a OpenFileDialog box. You select the file you want and click on open. The path is then displayed in the textbox. Here is my code:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If OpenFileDialog1.ShowDialog() = DialogResult.OK Then Try TextBox1.Text = OpenFileDialog1.FileName Catch ex As Exception Console.WriteLine("The file cannot be read") Console.WriteLine(ex.Message) End Try End If End Sub
As long as the application is on my hard drive, it works fine. When I put the .exe on the network, the textbox stays blank.
So I tried another thing.
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OpenFileDialog1.ShowDialog() TextBox1.Text = OpenFileDialog1.FileName End Sub
Again, this works fine on my hard drive. When I put the .exe on the network, I get this error message:
I have full control priveledges on this network drive. Any ideas on what gives?The application attempted to perform an operation not allowed by the security policy. The operation required the SecuriyException. To grant this application the required permission please contact your system administrator, or use the Microsoft .NET security policy administration tool.
If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will be shut down immediately.
Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
PublicKeyToken=b77a5c561934e089 failed.




Reply With Quote