I'm new to C# and the whole server/client thing, as an exercise I've made a simple board game for two players, now I'd like to make it playable on the net which is obviously not a trivial task (for me anywayz). I was looking for SIMPLE tutorials or articles about creating a web servers and clients, but havnt found anything basic enough - I need an example of client and server passing very basic pieces of data (strings?) on simple events between them, but the articles I've seen deal with more complex project. A point in the right directon would be very appreciated, thanx.
Remoting is an easy way of getting data flowing between the server and the clients.
Take a look at MSDN http://msdn2.microsoft.com/en-us/library/ms973857.aspx[^] or CodeProject http://www.codeproject.com/csharp/dotnetremotingbasictutor.asp[^]
Try creating two custom objects that you use as communication channels.
Let the server expose it's serverchannel object through remoting, and when client contacts the server through the channel, it can register the client and set up a remoting connection back to the clientchannel object, which the client exposes through remoting aswell.
You can put appropriate communication and game methods in these channels aswell as events which you can monitor.
-- Modified --
If you choose to go for a remoting solution where both sides expose a marshalled (remoting) object, remember to have each side set up their own remoting servers before they try and contact the other side. Otherwise the attemt at setting up local remoting server will fail as the remoting proxy from the otherside blocks the local server from being set up correctly.
without importing from win32 dll-s
or how do I communicate with a device with C# build in classes.
Does C# has something like this ? classes for registering/unregistering a service, and communicating via IOCTL's
Use DeviceIoControl without using Win32?? Impossible. You have no choice but to import the function calls.
how do I communicate with a device with C# build in classes.
That depends entirely on the device in question, but if it's not connected to a Serial Port, you don't. There are no classes native to the .NET Framework that deal with device communication, like USB, PCI, low level disk/volume work, ...
classes for registering/unregistering a service
Yes, this is built into the .NET BCL. I believe it's the ServiceInstaller[^] class in the System.ServiceProcess namespace.
In my program a have a series of images that i would like to save as an animated gif. Is this possible in c#, im using visual c# express ed. If not how easy/hard is it to save images into a windows movie file if at all possible.
The leave event occure when i push the tab button
What happen with me is when i put the first digit the leave event is called
this the code:
private void txtNewExpDate3_Leave(object sender, EventArgs e)
string val = this.txtNewExpDate3.Text;
this.txtNewExpDate3.Text = "0" + val;
and the MaxLength for the txtNewExpDate3 is 2
I do the same code is the same event in other textbox and it work properly.
I tried to recreate the bug you stated...but on my machine the code given by u works just fine..i.e. only when u press "TAB" key, does the leave event fire and not in any other case..please retest your code.
thanks and regards
Last Visit: 31-Dec-99 18:00 Last Update: 21-Sep-23 2:50