Click here to Skip to main content
15,920,576 members
Home / Discussions / C#
   

C#

 
AnswerRe: Visual Studio keeps telling me that my executable is in use Pin
Pete O'Hanlon4-May-10 1:43
mvePete O'Hanlon4-May-10 1:43 
GeneralRe: Visual Studio keeps telling me that my executable is in use Pin
WebMaster4-May-10 1:47
WebMaster4-May-10 1:47 
GeneralRe: Visual Studio keeps telling me that my executable is in use Pin
Pete O'Hanlon4-May-10 1:54
mvePete O'Hanlon4-May-10 1:54 
GeneralRe: Visual Studio keeps telling me that my executable is in use Pin
WebMaster4-May-10 3:05
WebMaster4-May-10 3:05 
GeneralRe: Visual Studio keeps telling me that my executable is in use Pin
PIEBALDconsult4-May-10 3:20
mvePIEBALDconsult4-May-10 3:20 
GeneralRe: Visual Studio keeps telling me that my executable is in use Pin
WebMaster4-May-10 3:21
WebMaster4-May-10 3:21 
GeneralRe: Visual Studio keeps telling me that my executable is in use Pin
PIEBALDconsult4-May-10 10:58
mvePIEBALDconsult4-May-10 10:58 
Questioncreae directory and copy file in this directory Pin
tanzeel853-May-10 22:23
tanzeel853-May-10 22:23 
AnswerRe: creae directory and copy file in this directory Pin
Peace ON3-May-10 22:29
Peace ON3-May-10 22:29 
GeneralRe: creae directory and copy file in this directory Pin
Swiftain3-May-10 22:50
Swiftain3-May-10 22:50 
GeneralRe: creae directory and copy file in this directory Pin
tanzeel853-May-10 23:37
tanzeel853-May-10 23:37 
GeneralRe: creae directory and copy file in this directory Pin
tanzeel853-May-10 23:38
tanzeel853-May-10 23:38 
GeneralRe: creae directory and copy file in this directory Pin
Mirko19804-May-10 0:25
Mirko19804-May-10 0:25 
GeneralRe: creae directory and copy file in this directory Pin
Michel Godfroid4-May-10 2:15
Michel Godfroid4-May-10 2:15 
GeneralRe: creae directory and copy file in this directory Pin
Luc Pattyn4-May-10 2:40
sitebuilderLuc Pattyn4-May-10 2:40 
AFAIK the situation is the same on Vista and Windows 7, and will continue to be so on newer versions of Windows:
- a lot of directories cannot be modified by a regular user; those include the top-level directory of your system partition (usually C: ) and all important directories such as /Windows, /Windows/system32, and /Program Files.
- as Michel said, you need an administrator account AND an app "running as administrator" so get over those restrictions.

What should work though is access to a number of special folders intended to hold your app's settings and local data, and other things like that. Have a look at Environment.GetFolderPath() and Environment.SpecialFolder

Within such directories, one usually creates a hierarchy of folders, so a typical sequence would be:
string fileSpec=Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)+
    @"\companyName\appName\logfile.txt";
string folder=Path.GetDirectoryName(fileSpec);
Directory.CreateDirectory(folder);  // no need to test existence first!
StreamWriter writer=File.CreateText(fileSpec);
...


Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.


QuestionMessage Removed Pin
3-May-10 22:22
karayel_kara3-May-10 22:22 
AnswerRe: access parallel.for class in .net framework 3.5 sp1 and installed sp4 Pin
Mirko19804-May-10 0:08
Mirko19804-May-10 0:08 
QuestionCheck available url's ion a DNS Server Pin
Herman<T>.Instance3-May-10 22:14
Herman<T>.Instance3-May-10 22:14 
AnswerRe: Check available url's ion a DNS Server Pin
Michel Godfroid4-May-10 2:23
Michel Godfroid4-May-10 2:23 
AnswerRe: Check available url's on a DNS Server Pin
Michel Godfroid4-May-10 21:27
Michel Godfroid4-May-10 21:27 
QuestionTransparent label problem Pin
TimSWatson3-May-10 21:46
TimSWatson3-May-10 21:46 
AnswerRe: Transparent label problem Pin
Abhinav S4-May-10 0:04
Abhinav S4-May-10 0:04 
AnswerRe: Transparent label problem Pin
Dave Kreskowiak4-May-10 4:30
mveDave Kreskowiak4-May-10 4:30 
AnswerRe: Transparent label problem Pin
Johnny J.12-May-10 12:58
professionalJohnny J.12-May-10 12:58 
QuestionExpert Advice needed ACTIVEX Executable Pin
ThatsAlok3-May-10 21:29
ThatsAlok3-May-10 21:29 

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.