creating files in dotnet on vista wtih stream writer

fguihen

Well-known member
Joined
Nov 10, 2003
Messages
248
Location
Eire
so on vista, when i use stream writer to create a file anywhere i specify on my pc. apparently though, i am not authroized to do so. i believe this is a security "feature" in vista, as i can create files if i specify my home directory ( in C:\users\username). does anyone know a way around this?
 
Certain areas of the file system are protected under vista and if you need to write to those areas then you will need to mark the application as requiring administrator privileges, easiest way of doing this is by providing a manifest for your application similar to the one found here.

This way you will be automatically prompted to elevate your permissions as soon as the application runs. Before doing this though it might be worth considering if you really do need to write to these parts of the file system - what does your application do that needs to write outside of a users part of the system?
 
Back
Top