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

C#

 
Questionsocket programming Pin
eey569-Mar-06 0:52
eey569-Mar-06 0:52 
QuestionRe: socket programming Pin
Divyang Mithaiwala9-Mar-06 2:50
Divyang Mithaiwala9-Mar-06 2:50 
AnswerRe: socket programming Pin
eey569-Mar-06 3:20
eey569-Mar-06 3:20 
GeneralRe: socket programming Pin
Divyang Mithaiwala9-Mar-06 4:10
Divyang Mithaiwala9-Mar-06 4:10 
GeneralRe: socket programming Pin
eey569-Mar-06 10:20
eey569-Mar-06 10:20 
AnswerRe: socket programming Pin
eey569-Mar-06 3:17
eey569-Mar-06 3:17 
QuestionWhat C# compiler does? Pin
Chandana Subasinghe9-Mar-06 0:40
Chandana Subasinghe9-Mar-06 0:40 
AnswerRe: What C# compiler does? Pin
leppie9-Mar-06 4:33
leppie9-Mar-06 4:33 
QuestionMultiThreading Pin
AB77719-Mar-06 0:24
AB77719-Mar-06 0:24 
GeneralRe: MultiThreading Pin
Steve Hansen9-Mar-06 0:42
Steve Hansen9-Mar-06 0:42 
GeneralRe: MultiThreading Pin
AB77719-Mar-06 1:07
AB77719-Mar-06 1:07 
GeneralRe: MultiThreading Pin
lmoelleb9-Mar-06 20:58
lmoelleb9-Mar-06 20:58 
QuestionHow to Show Only Images in "HtmlInputFile" Dialog ??? Pin
Abubakarsb8-Mar-06 23:47
Abubakarsb8-Mar-06 23:47 
AnswerRe: How to Show Only Images in "HtmlInputFile" Dialog ??? Pin
Vasudevan Deepak Kumar9-Mar-06 1:08
Vasudevan Deepak Kumar9-Mar-06 1:08 
Questionwhen the class is loaded in c#? Pin
shashank veerkar8-Mar-06 23:18
shashank veerkar8-Mar-06 23:18 
AnswerRe: when the class is loaded in c#? Pin
Chandana Subasinghe9-Mar-06 0:14
Chandana Subasinghe9-Mar-06 0:14 
QuestionMaking a Rich textbox control border to rounded rectangle Pin
psmukil8-Mar-06 23:01
psmukil8-Mar-06 23:01 
AnswerRe: Making a Rich textbox control border to rounded rectangle Pin
mav.northwind9-Mar-06 1:11
mav.northwind9-Mar-06 1:11 
GeneralRe: Making a Rich textbox control border to rounded rectangle Pin
psmukil9-Mar-06 1:30
psmukil9-Mar-06 1:30 
QuestionHow to handle System.NullReferenceException??? Pin
vikas_kohli828-Mar-06 22:39
vikas_kohli828-Mar-06 22:39 
AnswerRe: How to handle System.NullReferenceException??? Pin
Stefan Troschuetz8-Mar-06 23:10
Stefan Troschuetz8-Mar-06 23:10 
Questionhow to use shapes in word using c# Pin
sam_g18-Mar-06 22:00
sam_g18-Mar-06 22:00 
QuestionRoles in C# Pin
Brendan Vogt8-Mar-06 21:22
Brendan Vogt8-Mar-06 21:22 
Hi,

I had a default role for a new member in my web.config file. Something with a value like "Member", but now I changed it to the corresponding ID (auto incrementing value):

<add key="DefaultRoleForNewMember" value="2"/>

I have a public method that goes and retrieves this value. When the value was still a string and not the 2, my function worked like this:

public static int DefaultRoleForNewMember
{
get
{
string strRole = WebConfigurationManager.AppSettings["DefaultRoleForNewMember"]);
if (string.IsNullOrEmpty(strRole))
throw (new NullReferenceException("DefaultRoleForNewUser configuration is missing from your web.config. It must contain <appSettings> <add key=\"DefaultRoleForNewUser\" value=\"Member\" /> </appSettings>"));
else
return (strRole);
}
}

Now that I have the value of 2, I will have to convert it to an int when getting the value for the web.config file. But now my confusion comes in where I throw an exception, like I had for if (string.IsNullOrEmpty(strRole))

I hope this is clear enough. Please let me know.

Regards,
ma se
AnswerRe: Roles in C# Pin
Stefan Troschuetz8-Mar-06 22:58
Stefan Troschuetz8-Mar-06 22:58 
QuestionRe: Roles in C# Pin
Brendan Vogt8-Mar-06 23:48
Brendan Vogt8-Mar-06 23:48 

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.