P
pbd22
Hi.
I am building a custom telnet interface and my problem is that I
want to read the user input along with the previously written stream.
Right now I am logging the user.
I have
Login: Bill
Login is written by:
buffer = ASCII.GetBytes("Login: ");
_clientStream.Write(buffer, 0, buffer.Length);
Bill is entered by the user.
At the next return, I want to read:
"Login: Bill".
This is how I know its a Login read
and not a Password: read.
I am reading input with the following loop:
Code:
while (true)
{
_bytesRead = 0;
try
{
//blocks until a client sends a message
_bytesRead = _clientStream.Read(message,
0,4096); //message
}
catch
{
//a socket error has occured
break;
}
if (_bytesRead == 0)
{
break;
}
statusMessage += ASCII.GetString(message, 0,
_bytesRead);
But, my problem is that I get:
"Bill".
when the user submits his string.
How do I get both the written "Login: " and
the read "Bill" on the same read?
Please let me know if i need to provide more information,
otherwsie, thanks a lot for your response!
I am building a custom telnet interface and my problem is that I
want to read the user input along with the previously written stream.
Right now I am logging the user.
I have
Login: Bill
Login is written by:
buffer = ASCII.GetBytes("Login: ");
_clientStream.Write(buffer, 0, buffer.Length);
Bill is entered by the user.
At the next return, I want to read:
"Login: Bill".
This is how I know its a Login read
and not a Password: read.
I am reading input with the following loop:
Code:
while (true)
{
_bytesRead = 0;
try
{
//blocks until a client sends a message
_bytesRead = _clientStream.Read(message,
0,4096); //message
}
catch
{
//a socket error has occured
break;
}
if (_bytesRead == 0)
{
break;
}
statusMessage += ASCII.GetString(message, 0,
_bytesRead);
But, my problem is that I get:
"Bill".
when the user submits his string.
How do I get both the written "Login: " and
the read "Bill" on the same read?
Please let me know if i need to provide more information,
otherwsie, thanks a lot for your response!