Work with temp folder

vagueante

Active member
Joined
Feb 20, 2009
Messages
28
Location
Portugal
Programming Experience
10+
Hi,

I hava a form app, that runs hidden, with just a notify icon, the goal is control worker schedule and alert them for some things they have to do.

My problem is,when i open a form (with TopMost = True), it works if the user is admin of the machine or domain admin, if the user is "regular" user, the form just don't open or shown to the screen.

I believe that it has got something to do with write permissions in the app folder. I have a contextmenu that works great, even restoring the hidden main form, it just doesn't show/open the other form, without any error.

Shouldn't .net use the user $temp folder to write something? If not what's the best way for the app use the EnvironmentVariable("temp")?

Thanks
 
Not sure to the reasoning of the form not appearing but there are several options for getting the temp directory path

GetEnvironmentVariable("Temp")
Results: C:\DOCUME~1\UserAccountName\LOCALS~1\Temp


IO.Path.GetTempPath
Results : C:\Documents and Settings\UserAccountName\Local Settings\Temp

I would use the following for data that needs to be saved rather then temporary though:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
 
That's good idea, and i'll use it for temp data, but the other problem persists, i only need to open a form and show a count down with two buttons and two choices, and it still don't open no matter what and without any error, i'm lost
 
If I file could not be created/opened because of permissions, I would expect that you would receive an error rather then a form just not showing. Unless you handled the error without displaying a message.
 
If I file could not be created/opened because of permissions, I would expect that you would receive an error rather then a form just not showing. Unless you handled the error without displaying a message.


Sorry for the late reply, but had to test in production pc's.

In our domain policy in every folder created in c:, inside program files also, the permissions don't allow modify.

I've changed user permissions, and the form's start showing, so the problem is basically permissions in the APP folder.

So i assume that the APP writes in app folder, is there a way to put it writing in the user temp folder as a workingdir?

I'm using a setup project to create the install package
 
Back
Top