Re: Copying File to Program Directory

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"pooba53" <pooba53@xxxxxxxxx> schrieb:
My VB .NET application (created in VS 2003) resides in c:\Program Files
\Test\ and there's a data.mdb (Access) file within this directory.

I have a feature in my program that allows the user to import a backup
copy of this Access db if they need to.

I'm using the FileCopy method to simply copy over the data.mdb file
within the directory above. However, I get a
"System.UnauthorizedAccessException: Access to the path: c:\Program
Files\Test\data.mdb denied" when the copy is attempted.

I have admin rights to my XP computer and am wondering if this is some
sort of security issue. How does one write to the application
directory?

With administrator privileges this should work. However, it won't work for normal users.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

.



Relevant Pages

  • Re: Shipping Column
    ... Angrie.Woman schrieb: ... >>> country so I'll bet there's a tool coming for it. ... But that feature was introduced over a year ago. ... software available by now has implemented the international shipping costs. ...
    (alt.marketing.online.ebay)
  • Re: How to enable CTRL+ALT+BACKSPACE
    ... Am 06.07.2011 15:52, schrieb Ed Greshko: ... I suppose I'm just one of the lucky ones that have rarely needed this feature in ... When I've had this situation recently, due to bad nvidia driver ...
    (Fedora)
  • Re: Determine full name of an object at runtime.
    ... "Lance" schrieb ... >>What's your intention? ... > Having this feature would have allowed me to automate a part of my ...
    (microsoft.public.dotnet.languages.vb)
  • Re: sendmail auth - restrict user to local-host-names
    ... den 29.12.2004 schrieb shrek-m@gmx.de um 19:46: ... it is no feature at all. ... legal statement: http://www.uni-x.org/legal.html Fedora GNU/Linux Core 2 on Athlon kernel 2.6.9-1.6_FC2smp ...
    (Fedora)