|
Had a leg of lamb myself, roast potatoes, roast butternut, sweetish-sharp gravy... All good...
|
|
|
|
|
CCodeNewbie wrote: Had a leg of lamb myself, roast potatoes, roast butternut, sweetish-sharp gravy... All good...
Sounds like an equal festive meal - today, life's good
Bastard Programmer from Hell
|
|
|
|
|
tell it like it is fellow gastronaut... and thanks for looking in on the other thing that's making me tear my hair out...
Why do so may seemingly simple things have to be so complicated...
|
|
|
|
|
tried
if (s.Length == 6)
{
insns.Parameters["@Tstamp"].Value = DateTime.Now;
insns.Parameters["@SysID"].Value = SID;
insns.Parameters["@Protocol"].Value = s[0];
insns.Parameters["@LocalHost"].Value = s[1];
insns.Parameters["@LocalPort"].Value = s[2];
insns.Parameters["@RemoteHost"].Value = s[3];
insns.Parameters["@RemotePort"].Value = s[4];
insns.Parameters["@State"].Value = string.Empty;
insns.Parameters["@PID"].Value = s[5];
NSInfo.Open();
insns.ExecuteNonQuery();
NSInfo.Close()
};
same thing - service starts, netstat launches, CPU 99%
|
|
|
|
|
1.
CCodeNewbie wrote: if (Line == null) break;
Line can't be null at that point
2.
Do as Eddy said, check for the presence of 6 parts if you're consuming 6 parts. Never trust input, sooner or later it will not be what you expected, so cope with that.
3.
Keep a copy of the original input line, and display it in the exception thrown by the code Eddy added.
And/or log all the lines you are getting from netstat.
|
|
|
|
|
Have added in a new exception to display s.length.
Would you rather recommend
if(Line.length = 0)?
|
|
|
|
|
you already have an emptyOrNull test at the start, use that to exit the loop.
and I tend to display the original inputs when things go wrong, and optionally also derived values.
chances are NetStat occasionally emits a line you never expected!
|
|
|
|
|
Nothing to do with your question, but consider changing:
string Line = (Ns.StandardOutput.ReadLine());
to
StringBuilder Line = new StringBuilder((Ns.StandardOutput.ReadLine()));
and just call:
Line.Replace(" ", " ");
....
instead of
Line = Line.Replace(" ", " ");
...
Here the code is sequential and usage between string and StringBuilder is not that different, but if you do stringmanipulation in a loop, the performance difference can become huge.
Just a tip.
V.
|
|
|
|
|
I'm just starting WPF/C#, so it might be an easy question.
I have a listview on the left side of my wfp form and when I click on one of the listview icons I want to load an other wpf next to the listview.
But how do I load wpf1 on the main wpf and how do I unload wpf2 and load wpf2 when I click one of the listview icons
|
|
|
|
|
Just for fun i think you people should check out this software! And build it too if it's possible!
|
|
|
|
|
VKOntakte API method wall.get returns Json of type {"response": [message_count, {"id": 219, ...}, {"id": 219, ...}]}. The field "message_count" does not allow to use class for deserializing the response like {"response": [{"id": 219, ...}, {"id": 219, ...}]}. Please suggest me what kind of class structure should be used.
|
|
|
|
|
tfile101 wrote: VKOntakte API method
Have you tried their forum? There won't be much CP-users that have experience with this particular API. Support is usually available from the vendor.
tfile101 wrote: does not allow to use class
Why? Did you receive a compile-time error? If yes, what did it state?
tfile101 wrote: Please suggest me what kind of class structure should be used.
If they provide a way to serialize, I'd expect them to provide a way to deserialize. If not, take a look at JSON.NET[^].
Bastard Programmer from Hell
|
|
|
|
|
Hello,
I am developing a LAN chat messenger using .NET framework 3.5
I am quite new to all this, can some one tell me how i can store data like sign up/profile data, conversation etc on particular PC and retrieve later ?
Thanks in advance.
|
|
|
|
|
Cba1234 wrote: tell me how i can store data like sign up/profile dat
There are a number of ways you can store this information.
For small bits of data, you can use a text or ini file.
You can compress data and store it in your own format on the client machine (for large amounts of data).
|
|
|
|
|
Which dbms can i use in p2p?
|
|
|
|
|
Cba1234 wrote: Which dbms can i use
Any one you like; it largely depends on how much data you need to store: SQL server, SQL compact edition, Oracle, MSAccess etc.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Richard MacCutchan wrote: Any one you like; it largely depends on how much data you need to store: SQL server, SQL compact edition, Oracle, MSAccess
I almost never do a FTFY but this really deserves it, imagine mentioning that product in the database forum in anything but a disparaging manner.
(I am currently extracting requirements from one of the abominations)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It's cheap and cheerful: horses for courses, I say.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi,
I would like to export some images and some datatables to an excel sheet. Similarly I have to export to many other excel sheets in the same excel workbook using C#.
Is there any easier way of doing this?
Thanks in advance,
Thana
|
|
|
|
|
|
Hi,
I am giving animation to Reversi game, I have to show flip animation.after clicking on square,the adjacent piece should get flipped, it is actually an image. image should flip giving effect that it is flipping,from white to black or reversal. how to do that..??
|
|
|
|
|
What technology are you using? Silverlight? WPF? WinForms? JavaScript? Lego?
|
|
|
|
|
I am using Silverlight technology ...
|
|
|
|
|
Well, for a start, you should have posted this in the Silverlight / WPF forum. Secondly, please remember to post vital information like this in your post; don't waste everyone's time by forgetting to include something that is so fundamentally important.
You might find some joy using PlaneProjection[^].
|
|
|
|
|