|
Hi all,
I want to check the availability of some terminals whose ip I know previously or in other words are they online or not. I send them some test message and they should in return send the affirmative answer if they are online.I assume a server is running at each end which responds to the test message.I can do it between 2 terminals in udp(dont want to use tcp for this). But how to send the message to 4 different terminals. Because in this case I cant use the single socket that i used in case of 2 terminals.I am new to networking. So dont have much idea.Should I use multithreading or something like making multiple sockets but then the question comes how many .If I am wrong somewhere please let me know.
with thanks.....
|
|
|
|
|
Hi!
Why not just ping them? You can either call ping with Process.Start() or search for a C# implementation of ping. I think I remember seeing one here on CP.
mav
|
|
|
|
|
I would like to implement a Timer control to display text in a Panels() implementation in a StatusBar control. I would like to display the text for the time like (X Hours, X Minutes, X Seconds) from the moment that the application begins to run.
To develop the application, create a form, add a status bar, click on status bar, go to properties window, click on panels(), click on Add, add a panel, name the panel statusBarPanelTime, leave it as sunken, clear the Text property for the statusBarPanelTime control, go back to properties of the main form, change ShowPanels to true, Add a Timer control to the main form components tray, name the Timer control timerStatusBar, set its interval to 1000 and set the timer to enabled = true, put a timerStatusBar.start() event in the onLoad event for the form, double click the timerStatusBar object and in the _Tick event handler write statusBarPanelTimer.Text = ?
Now, here is the question, there is not any timerStatusBar.Text property to assign to the statusBarPanelTimer.Text property. There is also not an .Elapsed() method to implement. I looked at the articles available, and have found some Console code that only implements "Hello World". How would I assign the time elapsed since the application is opened to run and place it in the statusBarPanelTimer? Also, I would like to control the placement of the statusBarPanelTimer in the statusBar, perhaps positioning it to the right hand side in the statusBar, even placing it at a specific exact location in the statusBar. Request assistance.
|
|
|
|
|
your question confuses me.
/\ |_ E X E GG
|
|
|
|
|
Alex Eggie:
I am interested in adding a panel to the status bar that simply displays text starting from the time that the application begins. The text originally displays (0 Hours, 0 Minutes, 0 Seconds) and then increments each second in the format (X Hours, X Minutes, X Seconds) using a Timer control. However, I am not certain how to assign the current value for the timerStatusBar (timer control) to the statusBarPanelTimer control (panel in status bar) text property. I also need to be able to parse out the time from the Timer control in terms of hours, minutes and seconds, but I am uncertain where to even get the current value of the Timer control.
statusBarPanelTimer.Text = ?(timerStatusBar.Text does not exist)
Also, I would like to position the panel in the status bar either aligned to the right or to even position the status bar panel at a SPECIFIC location in the status bar. Would appreciate assistance.
Cordially,
New_Phoenix
|
|
|
|
|
So, you just want to display the time (hours, minutes, seconds) in a status bar?
Um, just add to your timer.tick method, statusBar.PanelWhatever.Text=DateTime.Now.toShortTimeString;
is that what you want??? I still don't understand exactly.
/\ |_ E X E GG
|
|
|
|
|
I think I got it...
When you application starts you need to remember the start time. So in your main form declare a variable like:
<br />
private DateTime startTime = DateTime.Now;<br />
Now in your Timer.Tick eventhandler do the following:
<br />
TimeSpan ts = DateTime.Now - startTime;<br />
string text = ts.Hours + " Hours, " + ts.Minutes + " Minutes, " + ts.Seconds + " Seconds";<br />
statusBarPanelTimer.Text = text;<br />
Regarding the other question: Have a look at the propertiesof the status bar panel. There is something like Alignment which you can use to align it to the right. A specific location can only be made by having all AutoSize properties of the statusbar panels to the left to false and assigning fix widths to them.
|
|
|
|
|
Robert Rohde:
Thanks, it worked great! Much appreciated!
Cordially,
New_Phoenix
|
|
|
|
|
Hi,
I'm fairly new to c# and I can't seem to access another object from another class when it is public, how can I do this? This is a much simplified version of the code:
public class Entry<br />
{<br />
public M2 ds1 = new M2();<br />
[STAThread]<br />
static void Main()<br />
{<br />
M1 test = new M1("hi");<br />
}<br />
}<br />
public class M1<br />
{<br />
public M1(string data)<br />
{<br />
ds1.Add(data);
}<br />
}<br />
public class M2<br />
{<br />
ArrayList data1 = new ArrayList();<br />
public M2()<br />
{<br />
}<br />
public void AddData(string data)<br />
{<br />
data1.Add(data);<br />
}<br />
}
|
|
|
|
|
Your problem hasnt much to do with C#. You should read some basic book about object oriented programming.
You cannot directly access ds1 of class Entry. For this you either need to declare the field static (which means there is only one value for the whole class and not for each instance) or access the field from an instance of the Entry class.
|
|
|
|
|
I need programmatic control device volume, location of that is :
control panel->sounds and audio device properties->device volume.
Or in the bottom right angle(volume icon).
Can i do this with .NET library? If no how do this with using WinAPI and С#?
|
|
|
|
|
I'm using Remoting with Configuration Files on the server and on the client.
I've read that after RemotingServices.Configure(filename) I can use the new operator to
get the remoted object from the server. But how does the compiler know to get the remoting object from the server and not simply creates a new object of the RemotableClass?
RemotingServices.Configure("Client.config")
RemotableClass rem = new RemotableClass();
Thanks.
|
|
|
|
|
Please advise me.
Thank You.
Sorry for bad English
|
|
|
|
|
I'm reading Inside C#. I 've just written a "Hello World" console app w/ VS.NET
I want to 'get into' the dumpbin. I then open a command prompt and change to the the folder w/ the App. It makes it all the way to:
dumpbin /HEADERS /CLRHEADER
But as soon as I append HelloWorld.exe I get a LINK 1181 error.
I then went to the "Path" and added the \bin and \VsaEnv folders (I think)
Tried it again- same error. Any ideas??? - thanks very much - this is very frustrating...
|
|
|
|
|
I have a simple HashTable defined that has a few objects in it as follows:
HashTable myHashTable = new HashTable();
Queue q12 = new Queue();
Queue q22 = new Queue();
Queue q33 = new Queue();
myHashTable.Add("A",q12);
myHashTable.Add("G",q22);
myHashTable.Add("K",q33);
How can I directly retrieve the 2nd queue (or the nth queue) in this list. Here is what
I tried that does not work
int n=1;
Queue myNthQueue = (Queue)
DictionaryEntry myEntry = (DictionaryEntry) userHashTable[n];
Queue whichQueueToPopFrom = (Queue) myEntry.Value;
string whichQueueToPopFromName = (string) myEntry.Key;
This compiles, but complains about nulls and does not work.
Any suggestions would be appreciated.
|
|
|
|
|
A Hashtable has no order. If you want to access items via key AND index you will have to search for another (hybrid style) class. I dont think there is one in the .NET framework, but I think there is one in the VisualBasic.Compatibility namespace which you can also use from within C#.
|
|
|
|
|
I typically have a small number of items in this class. Can I iterate through it and will the iteration always go in the same order if the items in the class don't change. (ie, no adds or removes)
|
|
|
|
|
|
i have been creating a program which is able to run over the internet bypassing the proxy server. is there a way for my client to connect to the server (using sockets)as well as receive/download files from the server?
thank you
|
|
|
|
|
|
did you use httpwebrequest/httpwebresponse and webproxy? is it possible to use those in socket programming?
|
|
|
|
|
Hmm. Not sure. I didn't actually go through a proxy.
Sorry
|
|
|
|
|
oh ok.. did you use webrequest and webresponse in your code?
|
|
|
|
|
|
how would you enable that, im using visual studio 2005 beta 1, .net framework 2.0 beta 1. i have the following controls set...
autocompletecustomsource = collection, it goes in an editor...
autocompletemode = suggest...
autocompletesource = custom source...
where am i going wrong? it doesn't work with those settings.
IM PROUD TO BE A GMAIL;
|
|
|
|