Click here to Skip to main content
15,914,323 members
Home / Discussions / C#
   

C#

 
AnswerRe: Array Sort Pin
fly9047-Mar-09 8:57
fly9047-Mar-09 8:57 
AnswerRe: Array Sort [modified] Pin
harold aptroot7-Mar-09 8:59
harold aptroot7-Mar-09 8:59 
QuestionClick images with webcam using c# Pin
Umangj7-Mar-09 8:26
Umangj7-Mar-09 8:26 
AnswerRe: Click images with webcam using c# Pin
DaveyM697-Mar-09 10:26
professionalDaveyM697-Mar-09 10:26 
GeneralRe: Click images with webcam using c# Pin
Umangj7-Mar-09 10:29
Umangj7-Mar-09 10:29 
GeneralRe: Click images with webcam using c# Pin
DaveyM697-Mar-09 11:20
professionalDaveyM697-Mar-09 11:20 
AnswerRe: Click images with webcam using c# Pin
Eddy Vluggen8-Mar-09 2:35
professionalEddy Vluggen8-Mar-09 2:35 
QuestionVista or .NET remember? Access to System32 Pin
NorbertKl177-Mar-09 6:48
NorbertKl177-Mar-09 6:48 
Hi everybody.
Just spent some very frustrating houres fighting with Vista.
Wanted to know, what exception I get, when I write to a folder where I hav no rights. OK - just some lines and I'll see:

StreamWriter sw = null;
try
{
sw = new StreamWriter( @"C:\Windows\System32\MyService\test.txt", true, Encoding.GetEncoding( "windows-1252" ) );
sw.WriteLine( "sometext" );
}
catch (Exception e)
{
MessageBox.Show( e, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning );
}
finally
{
if (sw != null) sw.Close();
}

I took C:\Windows\System32\MyService\test.txt because I was to lazy to change the rights of some testpath and I know (knew?) I could not write there as 'normal user'.
The result: no exception and no file???
what the?
check the path - OK
try to write from cmd (copy con: C:\Windows\System32\MyService\test.txt) - Access is denied. 0 file(s) copied.
So I change the rights for Users on C:\Windows\System32\MyService to Full Access.
Rerun of prog gives the same results???
copy con: now works
After some headscratching and wondering I changed the filename in the program to test2.txt. Now it writes the file. Back to test.txt - no exception and no writing???
Took away Full Access (and write and modify and write) and tried test3.txt. As expected no and no. Back to Full Access - test3.txt no and no, test4.txt no problem.
I created a new folder under System32. Same results as before.
If I do the same with a path like C:\testpath, everything works as expected. Normaly I can write, if I take away some rights (deny write or something) I get my exception (UnauthorizedAccessException by the way)

So how does .NET or something first supress an exception and then somehow remember it later?

Please help

Norbert

PS. please forgive any errors in my english
AnswerRe: Vista or .NET remember? Access to System32 Pin
harold aptroot7-Mar-09 7:22
harold aptroot7-Mar-09 7:22 
GeneralRe: Vista or .NET remember? Access to System32 Pin
NorbertKl177-Mar-09 8:31
NorbertKl177-Mar-09 8:31 
GeneralRe: Vista or .NET remember? Access to System32 Pin
harold aptroot7-Mar-09 8:53
harold aptroot7-Mar-09 8:53 
GeneralRe: Vista or .NET remember? Access to System32 Pin
NorbertKl177-Mar-09 9:22
NorbertKl177-Mar-09 9:22 
GeneralRe: Vista or .NET remember? Access to System32 Pin
Natza Mitzi8-Mar-09 9:46
Natza Mitzi8-Mar-09 9:46 
QuestionColor of label Pin
mrithula87-Mar-09 5:33
mrithula87-Mar-09 5:33 
AnswerRe: Color of label Pin
Luc Pattyn7-Mar-09 5:43
sitebuilderLuc Pattyn7-Mar-09 5:43 
GeneralRe: Color of label Pin
mrithula87-Mar-09 6:50
mrithula87-Mar-09 6:50 
AnswerRe: Color of label Pin
Luc Pattyn7-Mar-09 7:01
sitebuilderLuc Pattyn7-Mar-09 7:01 
GeneralRe: Color of label Pin
Expert Coming7-Mar-09 7:25
Expert Coming7-Mar-09 7:25 
GeneralRe: Color of label Pin
Colin Angus Mackay8-Mar-09 4:13
Colin Angus Mackay8-Mar-09 4:13 
AnswerRe: Color of label Pin
Luc Pattyn7-Mar-09 9:36
sitebuilderLuc Pattyn7-Mar-09 9:36 
GeneralRe: Color of label Pin
mrithula88-Mar-09 6:58
mrithula88-Mar-09 6:58 
AnswerRe: Color of label Pin
Luc Pattyn8-Mar-09 9:50
sitebuilderLuc Pattyn8-Mar-09 9:50 
QuestionInstalling application that queries FoxPro tables Pin
dptalt7-Mar-09 5:12
dptalt7-Mar-09 5:12 
QuestionHow to get the .exe file run after coying from a location to another location Pin
tyrone01097-Mar-09 2:52
tyrone01097-Mar-09 2:52 
AnswerRe: How to get the .exe file run after coying from a location to another location Pin
DaveyM697-Mar-09 3:08
professionalDaveyM697-Mar-09 3:08 

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.