|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Total VB.Net newbie - Directory.Exists questionDim b As Boolean
b = System.IO.Directory.Exists("c:\temp") MsgBox(b) Could someone explain why that returns FALSE when c:\temp quite evidently exists? Works here. What if you try to perform some oprations on this dir ? (such as
counting files, writing down a file or reading a file) ? -- Show quoteHide quotePatrice <ginol***@gmail.com> a écrit dans le message de news: 1144748986.982079.226***@v46g2000cwv.googlegroups.com... > Dim b As Boolean > b = System.IO.Directory.Exists("c:\temp") > MsgBox(b) > > Could someone explain why that returns FALSE when c:\temp quite > evidently exists? > Bizarrely, if I try to use fileContents =
System.IO.File.ReadAllText("C:\temp\input.txt") I get a "Security error" with the following message Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Again, that's odd as I'm admin of my machine and the directory has Full Control for Everyone. Ah well, I guess am learning slowly. It seems that the problems are
caused because my project resides (and therefore runs from) a network drive. When I save it and run it from C:, it works as expected. How do you resolve this little problem? <ginol***@gmail.com> schrieb:
> Ah well, I guess am learning slowly. It seems that the problems are You'll have to trust the application:> caused because my project resides (and therefore runs from) a network > drive. When I save it and run it from C:, it works as expected. <URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/1858a28b202f3f31> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> What, Visual Studio 2005 Express itself or my project? I presume I can
also do this via the .Net 2.0 Config Utility wizard (although how is another matter entirely) Your application. The .NET Framework handles Code Access Security i.e. the
code is not allowed to perform necessarery all actions in particular depending on its location. In VS 2005, you should have a dialog to do that automatically when you build... -- Show quoteHide quotePatrice <ginol***@gmail.com> a écrit dans le message de news: 1144755723.323722.317***@j33g2000cwa.googlegroups.com... > What, Visual Studio 2005 Express itself or my project? I presume I can > also do this via the .Net 2.0 Config Utility wizard (although how is > another matter entirely) > Hmm. When I select Build Application it just completes with a Build
Succeeded message. Sorry for asking what are probably totally dumb questions but I only installed VS 2005 Express yesterday and started playing with it today ;) In "Project properties" do you have a "Security" tab ? (translated from
French). It allows to tell which security should be applied to the ClickOnce application. If you don't have this in Express, you could configure manually using the control panel applet. The applet allows to create an MSI file to install this same policy on other PCs. The big picture may help (for example instead of dealing with c:\temp the application could perhaps use the "isolated storage") -- Show quoteHide quote<ginol***@gmail.com> a écrit dans le message de news: 1144770324.305405.121***@j33g2000cwa.googlegroups.com... > Hmm. When I select Build Application it just completes with a Build > Succeeded message. Sorry for asking what are probably totally dumb > questions but I only installed VS 2005 Express yesterday and started > playing with it today ;) > Sigh....how simple was that in the end? Yes, there is a security tab
and I enabled Clickonce Security Settings and set FileIOPermission to Include. Sure enough, all now works as expected. Thank you for your help and patience. Odd. in Visual Studio 2005 Express this code returns FALSE. In the
full version of Visual Studio 2005 it returns TRUE.
Sub Main() refusing to work
Reading .csv files containing the "-" character Inherent form controls resize How do I extend My.Resources System.Timers.Timer.Elapsed event not firing simple queue How to simplifying boolean algebra expression? How to simplifying boolean algebra expression? Edit and Continue doesn't work Filling resized panel with form |
|||||||||||||||||||||||