c# telnet server Network stream

Discussion in 'Software' started by mastermosley, Mar 6, 2009.

  1. mastermosley

    mastermosley Sergeant

    Hi, I'm building a telnet chat server and I've ran into a problem. I've been successful with programming it except for one thing. I can connect to the server no problem it displays my welcome screen and asks for login information. The only problem is when I backspace in my client it doesn't delete the character it just moves the cursor over to the left. I want it to backspace, I'm using NetworkStream, StreamReader and StreamWriter.
     
  2. PC-XT

    PC-XT Master Sergeant

    Does Delete work?
    I don't do C#, but I usually handle problems like that by taking input in a more basic way, such as a text buffer, then converting to the desired stream, at least until I find the problem. I found these links on Google:
    At the end of class #3's comments,
    http://www.codeproject.com/KB/IP/smtpconsole.aspx?display=PrintAll says backspace's behavior was changed. I think it uses C#'s NetworkStream, StreamReader, and StreamWriter in case you want a look.
    http://www.eggheadcafe.com/community/aspnet/2/59972/forbid-backspace-button-t.aspx shows how to override input handlers. Here they disable backspace.
    http://msdn.microsoft.com/en-us/library/system.console.readline(VS.80).aspx gives an example line reader that includes backspace.
     
  3. mastermosley

    mastermosley Sergeant

    Yah, thats what I want to do, get a line buffer going but I don't no how to do that in c#. Only way I no how to read streams from a remote connection is via network stream and stream reader although Im sure there is a way.
     
  4. PC-XT

    PC-XT Master Sergeant

    There is BufferedStream, which is a byte stream class. The client input would use this (or another stream, if a better one is found) to buffer directly. Once entered, the data should then be written to the network stream to be received by the server.
     
  5. PC-XT

    PC-XT Master Sergeant

    Another byte stream that may possibly be used is MemoryStream. I do not really know these well, as I don't do C#. You may want to wrap them in a character stream like a stream/string reader/writer. I think all of these are in the System.IO namespace.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds