Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
QuestionOpening a Folder Pin
usermans17-Feb-07 19:31
usermans17-Feb-07 19:31 
AnswerRe: Opening a Folder Pin
Christian Graus17-Feb-07 20:12
protectorChristian Graus17-Feb-07 20:12 
GeneralRe: Opening a Folder Pin
usermans17-Feb-07 20:22
usermans17-Feb-07 20:22 
QuestionC# Dll Debugging Pin
usermans17-Feb-07 19:21
usermans17-Feb-07 19:21 
AnswerRe: C# Dll Debugging Pin
Christian Graus17-Feb-07 19:23
protectorChristian Graus17-Feb-07 19:23 
GeneralRe: C# Dll Debugging Pin
usermans17-Feb-07 19:36
usermans17-Feb-07 19:36 
GeneralRe: C# Dll Debugging Pin
Christian Graus17-Feb-07 20:00
protectorChristian Graus17-Feb-07 20:00 
Questiontry-catch question ... Pin
Hussam Fattahi17-Feb-07 18:56
Hussam Fattahi17-Feb-07 18:56 
while using try-catch combination, I've assign a value to a reference type variable within
try block, but when I tried to use this variable within catch block it throw an exception (NullRefrenceException) or an error (use of unassigned local variable) occur.

my question is: the variables that has been declared, or had values assigned
for them in try block, how to deal with them in catch block.

the code I'm working on :

int i =0;
Socket remote;
            try
            {
                remote = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                i = 5;
            }
            catch(Exception ee)
            {
                 MessageBox.Show(i.ToString());
                 MessageBox.Show(remote.ToString()); //the error occured here. 
                 
            }
and why is that when i used a value type variable it works well.
AnswerRe: try-catch question ... Pin
Christian Graus17-Feb-07 19:22
protectorChristian Graus17-Feb-07 19:22 
GeneralRe: try-catch question ... Pin
Hussam Fattahi17-Feb-07 19:48
Hussam Fattahi17-Feb-07 19:48 
GeneralRe: try-catch question ... Pin
Christian Graus17-Feb-07 20:09
protectorChristian Graus17-Feb-07 20:09 
GeneralRe: try-catch question ... Pin
Scott Dorman18-Feb-07 4:21
professionalScott Dorman18-Feb-07 4:21 
Questiontransparent floating window Pin
sushantkaura17-Feb-07 18:38
sushantkaura17-Feb-07 18:38 
AnswerRe: transparent floating window Pin
Ed.Poore17-Feb-07 20:00
Ed.Poore17-Feb-07 20:00 
GeneralRe: transparent floating window Pin
sushantkaura17-Feb-07 20:48
sushantkaura17-Feb-07 20:48 
QuestionTrayIcon Application Pin
neTo8417-Feb-07 17:06
neTo8417-Feb-07 17:06 
AnswerRe: TrayIcon Application Pin
Stefan Troschuetz17-Feb-07 20:49
Stefan Troschuetz17-Feb-07 20:49 
QuestionWindows Applications Problems in C#..please i need help..thank you.. Pin
icesha17-Feb-07 16:36
icesha17-Feb-07 16:36 
AnswerRe: Windows Applications Problems in C#..please i need help..thank you.. Pin
Christian Graus17-Feb-07 19:24
protectorChristian Graus17-Feb-07 19:24 
GeneralRe: Windows Applications Problems in C#..please i need help..thank you.. Pin
icesha17-Feb-07 19:42
icesha17-Feb-07 19:42 
GeneralRe: Windows Applications Problems in C#..please i need help..thank you.. Pin
Christian Graus17-Feb-07 20:10
protectorChristian Graus17-Feb-07 20:10 
GeneralRe: Windows Applications Problems in C#..please i need help..thank you.. Pin
icesha17-Feb-07 20:14
icesha17-Feb-07 20:14 
GeneralRe: Windows Applications Problems in C#..please i need help..thank you.. Pin
Luc Pattyn18-Feb-07 3:47
sitebuilderLuc Pattyn18-Feb-07 3:47 
QuestionC# Decompiler Pin
Eddymvp17-Feb-07 10:43
Eddymvp17-Feb-07 10:43 
AnswerRe: C# Decompiler Pin
Colin Angus Mackay17-Feb-07 11:22
Colin Angus Mackay17-Feb-07 11:22 

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.