Click here to Skip to main content
15,915,019 members
Home / Discussions / C#
   

C#

 
QuestionHow to check files exists *.xml Pin
Hema Bairavan1-May-09 2:53
Hema Bairavan1-May-09 2:53 
AnswerRe: How to check files exists *.xml Pin
Jimmanuel1-May-09 3:13
Jimmanuel1-May-09 3:13 
GeneralRe: How to check files exists *.xml Pin
Hema Bairavan1-May-09 3:22
Hema Bairavan1-May-09 3:22 
GeneralRe: How to check files exists *.xml Pin
Jimmanuel1-May-09 3:29
Jimmanuel1-May-09 3:29 
GeneralRe: How to check files exists *.xml Pin
Hema Bairavan1-May-09 3:31
Hema Bairavan1-May-09 3:31 
GeneralRe: How to check files exists *.xml Pin
Jimmanuel1-May-09 3:35
Jimmanuel1-May-09 3:35 
Questionrunning an application through network Pin
Genius.Boy1-May-09 2:31
Genius.Boy1-May-09 2:31 
AnswerRe: running an application through network Pin
Nagy Vilmos1-May-09 3:53
professionalNagy Vilmos1-May-09 3:53 
AnswerRe: running an application through network Pin
Dave Kreskowiak1-May-09 4:02
mveDave Kreskowiak1-May-09 4:02 
QuestionProblem with appconfig while uninstalling project Pin
Narendra Reddy Vajrala1-May-09 2:09
Narendra Reddy Vajrala1-May-09 2:09 
AnswerRe: Problem with appconfig while uninstalling project Pin
Mycroft Holmes1-May-09 2:24
professionalMycroft Holmes1-May-09 2:24 
GeneralRe: Problem with appconfig while uninstalling project Pin
Narendra Reddy Vajrala1-May-09 2:40
Narendra Reddy Vajrala1-May-09 2:40 
QuestionMULTI PROCESS Pin
KALAMN1-May-09 2:06
KALAMN1-May-09 2:06 
AnswerRe: MULTI PROCESS Pin
Genius.Boy1-May-09 2:08
Genius.Boy1-May-09 2:08 
AnswerRe: MULTI PROCESS Pin
Eddy Vluggen1-May-09 2:44
professionalEddy Vluggen1-May-09 2:44 
QuestionSocket comunication problem Pin
rareseu1-May-09 0:29
rareseu1-May-09 0:29 
AnswerRe: Socket comunication problem Pin
Henry Minute1-May-09 0:55
Henry Minute1-May-09 0:55 
rareseu wrote:
try
{
NetworkStream networkStream = new NetworkStream(socketForClients);
System.IO.StreamWriter messageWriter = new System.IO.StreamWriter(networkStream);
System.IO.StreamReader messageReader = new System.IO.StreamReader(networkStream);
}
catch (Exception eNetworkStream)
{
System.Windows.Forms.MessageBox.Show("EROARE : eroare la network stream\nEXCEPTIE : "+eNetworkStream.Message);
}// try/catch


This is where your problem is likely to be.

By declaring and instantiating the objects inside a code block (the try/catch block in this case) they are not visible to code outside of the block.

You have already declared the streams outside the block, so you are declaring new ones inside the block.

Just remove the bits, from inside the try block, struck out below and all should be well:

System.IO.StreamWriter messageWriter =


Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Socket comunication problem Pin
rareseu1-May-09 1:26
rareseu1-May-09 1:26 
QuestionHow to add one button onto a winForm with code in the design environment Pin
mctramp1681-May-09 0:16
mctramp1681-May-09 0:16 
AnswerRe: How to add one button onto a winForm with code in the design environment Pin
DaveyM691-May-09 0:28
professionalDaveyM691-May-09 0:28 
GeneralRe: How to add one button onto a winForm with code in the design environment Pin
mctramp1681-May-09 1:13
mctramp1681-May-09 1:13 
GeneralRe: How to add one button onto a winForm with code in the design environment Pin
Henry Minute1-May-09 1:21
Henry Minute1-May-09 1:21 
GeneralRe: How to add one button onto a winForm with code in the design environment Pin
mctramp1681-May-09 2:46
mctramp1681-May-09 2:46 
GeneralRe: How to add one button onto a winForm with code in the design environment Pin
mmgbmm1-May-09 4:32
mmgbmm1-May-09 4:32 
Question[Message Deleted] Pin
saoda1-May-09 0:03
saoda1-May-09 0:03 

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.