Click here to Skip to main content
15,909,091 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem Reading And Writing Registry In C# Pin
Luc Pattyn20-Sep-09 5:21
sitebuilderLuc Pattyn20-Sep-09 5:21 
Hi,

some remarks:

1.
exceptions tend to contain a lot of information, however you need to look at all of it, i.e. use Exception.ToString() instead of Exception.Message

one of the pieces of information it offers is a filename and linenumber; that would point straight to the culprit line. Also teach your IDE to always show line numbers in edit windows, see here[^].

2.
Recent Windows versions don't allow a regular user to access/modify system settings that would extend to other users; the LocalMachine registry hive would be in that category.

3.
Your expiration test needs a less than comparison, not an equals. DateTimes seldom are equal as they contain information up to the tick (one tenth of a microsecond).

Smile | :)

Luc Pattyn

Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

Local announcement (Antwerp region): Lange Wapper? Neen!


AnswerRe: Problem Reading And Writing Registry In C# Pin
Richard MacCutchan20-Sep-09 5:30
mveRichard MacCutchan20-Sep-09 5:30 
AnswerRe: Problem Reading And Writing Registry In C# Pin
Alan N20-Sep-09 8:02
Alan N20-Sep-09 8:02 
GeneralRe: Problem Reading And Writing Registry In C# Pin
Ben Magee20-Sep-09 8:24
Ben Magee20-Sep-09 8:24 
GeneralRe: Problem Reading And Writing Registry In C# Pin
Luc Pattyn20-Sep-09 8:34
sitebuilderLuc Pattyn20-Sep-09 8:34 
GeneralRe: Problem Reading And Writing Registry In C# Pin
Ben Magee20-Sep-09 8:36
Ben Magee20-Sep-09 8:36 
GeneralRe: Problem Reading And Writing Registry In C# Pin
Luc Pattyn20-Sep-09 9:09
sitebuilderLuc Pattyn20-Sep-09 9:09 
GeneralRe: Problem Reading And Writing Registry In C# Pin
Richard MacCutchan20-Sep-09 9:34
mveRichard MacCutchan20-Sep-09 9:34 
QuestionPlaying multiple wav files simultaneously in C# Pin
Zorro00020-Sep-09 3:37
Zorro00020-Sep-09 3:37 
AnswerRe: Playing multiple wav files simultaneously in C# Pin
N a v a n e e t h20-Sep-09 4:36
N a v a n e e t h20-Sep-09 4:36 
GeneralRe: Playing multiple wav files simultaneously in C# Pin
Zorro00020-Sep-09 10:02
Zorro00020-Sep-09 10:02 
GeneralRe: Playing multiple wav files simultaneously in C# Pin
N a v a n e e t h20-Sep-09 16:58
N a v a n e e t h20-Sep-09 16:58 
Questionhelp with udp code snippet... Pin
emperorhere20-Sep-09 3:19
emperorhere20-Sep-09 3:19 
AnswerRe: help with udp code snippet...[CrossPost] Pin
Richard MacCutchan20-Sep-09 3:55
mveRichard MacCutchan20-Sep-09 3:55 
AnswerRe: help with udp code snippet... Pin
EliottA20-Sep-09 3:55
EliottA20-Sep-09 3:55 
AnswerRe: help with udp code snippet... Pin
harold aptroot20-Sep-09 4:28
harold aptroot20-Sep-09 4:28 
Questionhelp with udp code snippet... Pin
emperorhere20-Sep-09 3:17
emperorhere20-Sep-09 3:17 
AnswerRe: help with udp code snippet... Pin
N a v a n e e t h20-Sep-09 3:34
N a v a n e e t h20-Sep-09 3:34 
QuestionProgramatic Font Install Pin
HighCloud20-Sep-09 2:11
HighCloud20-Sep-09 2:11 
AnswerRe: Programatic Font Install Pin
Richard MacCutchan20-Sep-09 2:32
mveRichard MacCutchan20-Sep-09 2:32 
GeneralRe: Programatic Font Install Pin
HighCloud20-Sep-09 3:03
HighCloud20-Sep-09 3:03 
GeneralRe: Programatic Font Install Pin
Luc Pattyn20-Sep-09 3:24
sitebuilderLuc Pattyn20-Sep-09 3:24 
GeneralRe: Programatic Font Install Pin
HighCloud20-Sep-09 3:51
HighCloud20-Sep-09 3:51 
GeneralRe: Programatic Font Install Pin
Richard MacCutchan20-Sep-09 4:05
mveRichard MacCutchan20-Sep-09 4:05 
GeneralRe: Programatic Font Install Pin
HighCloud20-Sep-09 4:37
HighCloud20-Sep-09 4:37 

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.