I've had a similar problem where StreamReader.ReadLine() gobbled up one too many line endings while waiting for input over a NetworkStream. I ended up writing my own ReadLine() function to solve this problem.
Steven Behnke
Posts
-
StreamReader.ReadLine() Problem -
Annoying AIM adshttp://jon8rfc.homeip.net/aim/adremoval/ I just installed this and it works very well. It doesn't even display the box for the ads anymore. Its also possible to just add ads.aim.com to your hosts flie and point it to the 127.0.0.1 address. Thanks, Steven
-
Valid CodeProject Article?Hey guys, My friend and I just finished up an article describe a product of ours called TwainSharp. I was wondering if you guys wouldn't mind taking a look at the article to see if it would be a good fit to post on code project or not. http://xsdev.net/tutorials/twainsharp/ Thanks, Steven
-
Distributing C# .NET programs... major headache.Isn't this something that was fixed in DirectX 9.0a? I was having problems with the IDE even finding the proper files until I installed this new version and then they went away.
-
Please Help with "\n"Or you could use Environment.NewLine
-
SSN Format Query?I was looking for a SQL query that will allow me to take a 9 digit numeric value in a varchar field and format it in a standard social security format, ie: ###-##-####. So basically I'd like to update all of the migrated records, some of which have the dashes already, some of which don't, and standardize the format. I could of course do a select * from the table, and write a program to do this one row at a time, but I would rather do this globally with a query if possible. Thanks, Steven.
-
Error in Image.save From PictureBoxThere is a much simpler solution. // Create a memory stream MemoryStream mStream = new MemoryStream(); // Save the image to the memory stream Image.Save(mStream, ...); // Then write the buffer to a file. fileStream.Write(mStream.GetBytes(), 0, mStream.Length); I'm doing this off the top of my head, so the syntax may be slightly off, but the concept is solid. I use it all the time. Thanks, Steven
-
Focusless button?For the moment I've used labels, SendKeys.Send() and onClick for the labels. Let me know if anyone finds a better solution with buttons. Thanks, Steven
-
Focusless button?Hey guys, I'm trying to develop a C# User Control that allows me to send key events. I can use SendKeys.Send() no problem, but it focuses the button so that the button recieves the keydown/keyup/keypress events. I've tried to make my own button and override WndProc(). I'm blocking WM_FOCUS = 7, but no luck. Does anyone have an idea? Thanks, Steven
-
.NET 2003 and C# - Need to deploy app...You can use VisualStudio itself to build installers fairly easliy. Check out the C# Today tutorial: http://www.csharptoday.com/content.asp?id=1691
-
Interop Strong Names?Nevermind guys, I found it. It was listed under the C# Project Options called: "Wrapper Assembly Key File." Thanks, Steven
-
Interop Strong Names?Is there anyway to fool the compiler into working with an Interop library with a strong name? I am receiving the following error when trying to compile my app and sign it. Assembly generation failed -- Referenced assembly 'Interop.WIALib' does not have a strong name Thanks, Steven
-
beginner question in C#You'll need to do something like this... int[,] output = new int[10, 100]; for (int i = 0; i < 10; i++) output[i,0] = func();
-
RTF ScrollingWhat is the proper way to scroll and RTF box when text is entered from network communication? The app looks something like that following +------------+ | RTF Object | | output | +------------+ | Input | +____________+ My method has been something like rtfObject.focus(); rtfObject.ScrollToCaret(); input.focus(); The problem with this is that the input.focus() will select all of the text if you happen to hit the space bar at the same time that it focuses the object. I would rather be able to just get the vertical scrollbar object and set it to max, but I have no idea how to do this. Thanks, Steven
-
ImageFormat and EncoderParams?Does anyone have an example of changing the quality of a JPEG that you are saving out with the Bitmap.Save() method? Thanks, Steven
-
Network Protocol Design?I'm writing an application for collaboration where images are streamed from a capture source and it also allows users chat with text chat. So I've designed a network protocol where I can designate the type of command and various other arguments, etc... When this works it works very well, and when it breaks it really breaks. This has gotten me wondering how other developers handle these problems. Can anyone reccomend a good book or a web article, or even personal exprience on how to handle these issues concerning network protocol design? Thanks, Steven
-
BinaryWriterI am writing a client/server application with the server running on Linux written in C++ and the client application running on Windows XP written in C#. I am sending JPEG images over the network from cient to server and am getting some very odd behavior. It appears that after each JPEG I transmit I get about 1 - 3 packets containing 1 byte of useless information. Is this something with BinaryWriter that is it sending additional informaiton about what it sent? Thanks, Steven
-
What's wrong with IE6??What it appears to be is that if you have your status bar on be default in IE6 that when you launch a new IE browser instance from either the Start Menu or a shortcut everything is fine. If you take that same browser and go to File->New you will get a new IE window without a status bar. Same problem exists with popups I imagine. :wtf: -Steven
-
Scrolling in a RichTexBoxIt is a little strange. I had even tried passing the parent object as a part of a setup function, and then calling a method on that object to focus the object, but still no go. For some reason it appears that .Focus() doesn't function inside of a subthread.
-
Scrolling in a RichTexBoxAll you will need to do is... int index=dialogTextBox.TextLength; dialogTextBox.AppendText(message+"\r\n"); // Inserted here dialogTextBox.Focus(); dialogTextBox.Select(index, message.Length); dialogTextBox.SelectionColor=myColor; // Focus your entry box back again here. Or you can write an On Text Changed handler, like I had to that will focus the box, scroll to the caret, then focus back to the entry. You will have to do this if you are adding text to the box from a thread that you created to read from the socket like I did. Doh! -Steven