|
I would like to build a server monitor in C#. Anyone have any good ideas ? I know checking the server is still running can be done w/ Ping.
What about the FTP service ?
What about the web server ? ( Sure we can do this w/ WebRequest Obj. and just look for a string but is there a better way ??)
Anyone ?
|
|
|
|
|
I have a custom collection that I built that contains strings, doubles and datetimes. When I try and retrieve that collection from the server I get the following error:
"The type BarCollection in Assembly, Version=1.0.1106.204, Culture=neutral, PublicKeyToken=null is not marked as serializable."
I've derived from CollectionBase and implemented my Add and an indexer (strongly typed). The collection contains a structure that contains the aforementioned strings, doubles and datetimes. I've declared it as [Serializable].
<br />
[Serializable]<br />
public class BarData<br />
{<br />
public DateTime BarDateTime;<br />
public string BarName;<br />
public double d1;<br />
public double d2;<br />
public double d3;<br />
}<br />
and here's a snippet of my collection
<br />
public class BarCollection : CollectionBase<br />
{<br />
public void Add(BarData bar)<br />
{<br />
List.Add(bar);<br />
}<br />
<br />
public BarData this[int Index]<br />
{<br />
get<br />
{<br />
return (BarData)List[Index];<br />
}<br />
set<br />
{<br />
List[Index] = value;<br />
}<br />
}<br />
}<br />
<br />
...<br />
I assume the problem is with the non string members, but what else do I need to do to get this sucker over the wire?
Thanks.
Give me one more medicated peaceful moment
|
|
|
|
|
|
Right above my class definition for BarCollection I have the [Serializable] attribute. Do I need to do something else?
Give me one more medicated peaceful moment
|
|
|
|
|
|
Thanks for the suggestions, however, I figured out the problem. Yes, BarData had to be marked as serializable, but even though BarCollection is derived from CollectionBase which is supposedly already serialized, I still have to add the [Serializable] attribute above that class as well.
This is probably something that is glaringly obvious to anyone that knows anything about remoting ... but did I mention that this is the first day that I've tried it?
Thanks for the replies!
Give me one more medicated peaceful moment
|
|
|
|
|
whats the easyest way too adjust a track bar value from 1 too 100, into a double starting at 1.0 and working its way down to .0001 (for form opacity).
i have it working with a huge switch, but i want a cleaner way to take the int value of say 100 too the double value of .0001
|
|
|
|
|
form.Opacity = (double)trackBar.Value / 1000000;
I think that should work...
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
thanks alot =) you just gave me back 200 lines of code i bet.. (it looks like that would work too me too...)
im going too school as we speak to get my mcsd from a microsoft certified school.. for someone trying to become a windows app programmer (eventually games) is this a good start ?
|
|
|
|
|
Actually, I would look at this article instead. It seems to work:
http://www.codeproject.com/csharp/transparentwindowsincsharp.asp[^]
I think Game Dev would be better done in C++. You can do it in C#, but I haven't really seen a game written in C# aside from Chris Sells' Wahoo[^]
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
|
You're right. I should have just done this:
Form.Opacity = trackBar.Value / 100;
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
I am having a problem with aborting updates in a DataTable.
I am hooked into the RowChanging Event and, as the docs say, throwing an exception to cause the update to abort.
My problem is that the DataSet does not catch this exception and it bubbles all the way up to Main() which is a bit to late to do anything with.
For this example I have a single form with a ListBox and a TextBox bound to a strongly typed DataSet.
Anyone know how to handle this situation
Thanks
Sttephen.
|
|
|
|
|
could you try butting your listbox on a seperate thread and abort the thread ? or maybe try putting the update in a while statement with a bool.... ie.
it would be a pain too do it with the while statement though cause it would stay in it until the update tells it not too. i would try threads.
while(turnOffUpdateflag==false)
{
;//do my update
}
while(myThread.IsAlive == true)
{
;//do update
}
|
|
|
|
|
<shudder>
There as to be a better way!
I am trying to validate the row when the list changes to a different row. This triggers the RowChanging event from the dataset. If I create the ListBox on another thread, when I abort the thread, surely I would lose the list box as well, and would have to recreate it and restore it to it's current state.
15 minute project has now managed to waste the best part of a day!!
This looked so simple when I read the docs. LOL, should have known better by now!
Stephen.
|
|
|
|
|
i have a encryption program with the encryption method....the recursive file search method..all running on a string... when the user clicks stop..... it cancels the threads ..and the results that were found before the thread stopped are still in the list box... then when the user clicks the search button agian i tell the program too recreated the thread agian and it startes over
any time you abort a thread you have to reintialize it ie
make a private void just for your threads so you can call on then and get them reintialized when ever needed.
i have never used a datagrid before (isnt that what you are using? cant remeber) but this has always worked for listboxes atleast.
private void mylistboxThread()
{
Thread Update = new Thread(new ThreadStart(updatefunctions))
}
private void updateFunctions()
{
//put your update code here.
}
Update.Start();//start thread
Update.Abort();//abort thread
jesse m 
|
|
|
|
|
But you are in control of starting the thread. What I want to do is in response to a users click on the listbox, which will be triggered from an incoming windows message (WM_MOUSE_DOWN or what ever) via the forms message loop that is running on the forms main thread, therefor my thread of execution would never make it onto my thread.
Make sense?
Stephen.
|
|
|
|
|
I'm making a deployment msi in VS.net, and I want to make the registry entry for the app be:
HKEY_CURRENT_USER
Software
[Manufacturer]
[ProductName]
v[Version]
myvariablehere
what happens is, Manufacturer and ProductName get replaced as they should, but version just gets "v" without the version number after it. I also tried just "[Version]" but that didn't work either. Am I doing something wrong or can you not write the version into the name?
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
hey What's up?
Okay I am trying to simulate the login screen that XP uses. Each opacid login box will be it's own form so i can control the opacity. The background form will be the MDI container for all the login forms.
But I don't want the border ARRGGGG around the entire MDI container!!!
Someone help....
Peace.
|
|
|
|
|
Wonder how to make a rubber band drawing with GDI+ in C#.
Have used SetROP2( R2_XORPEN ) in C++ before, but that little function seemes to be gone in GDI+.
Have tried to use interop with GDI, but there are quite a few functions that needs to imported and beeing lazy I want to know if there is a simpler way.

|
|
|
|
|
|
Thanks for the help. I thought I had looked everywhere, but apperantly not.

|
|
|
|
|
I have a string that will have a negative number as either the first 2 or 3 characters of it (including negative sign) immediately following this there is a colon :
How can I copy everything before this initial colon into another variable.
Reason for this: I need to perform some mathematical manipulation on this value but there is no way for me to get at it but via string because of the special characters.
Thanks
********************
* $TeVe McLeNiThAn
********************
|
|
|
|
|
|
That's what it is. Thank you so much. I have done the same thing before but couldn't remember it exactly.
Thanks again!
********************
* $TeVe McLeNiThAn
********************
|
|
|
|