Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
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 
AnswerAnswer! Pin
Nagy Vilmos1-May-09 0:11
professionalNagy Vilmos1-May-09 0:11 
AnswerAnswer Pin
dan!sh 1-May-09 0:12
professional dan!sh 1-May-09 0:12 
AnswerRe: Question! Pin
SimpleData1-May-09 0:19
SimpleData1-May-09 0:19 
QuestionProblem with events code and thread (long post) Pin
Otex30-Apr-09 23:02
Otex30-Apr-09 23:02 
AnswerRe: Problem with events code and thread (long post) Pin
Nicholas Butler1-May-09 0:35
sitebuilderNicholas Butler1-May-09 0:35 
GeneralRe: Problem with events code and thread (long post) Pin
Otex1-May-09 0:48
Otex1-May-09 0:48 
AnswerRe: Problem with events code and thread (long post) Pin
Nicholas Butler1-May-09 5:22
sitebuilderNicholas Butler1-May-09 5:22 
QuestionRe: Problem with events code and thread (long post) Pin
Otex3-May-09 5:43
Otex3-May-09 5:43 
AnswerRe: Problem with events code and thread (long post) Pin
Nicholas Butler3-May-09 7:43
sitebuilderNicholas Butler3-May-09 7:43 

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.