Member Avatar for micmo

Hi guys,

I've been searching for hours now and haven't yet found a good source of C# information for what I need to do.

The general gist is this:

I have 1 Client app (a simple windows form which gathers data) and 1 Server console app (which holds the business logic)

The client needs to send a file (which is a serialized class object called info.sco) to the server and then call a specific server method on that file.

User enters data into a form on the client app
Client app adds the data to a custom class
User clicks a button (New, Edit, Delete)
Client App sends the file to the server as a bytestream

Depending which button the user clicks, a different method needs to be called on the server (Create, Edit, Delete etc) with the data from the file just recieved.

Now I know how to serialize and deserialize the class into a file. What I'm getting stuck on is how to physically send the file over the network, call the methods on the server, then get a confirmation back from the server.

I've looked into sockets, and think this is the best way, but I can't figure out the actual way to do it - there are lots of tuts on this, but none that are very specific to my needs.

Any ideas on the best method to do this?

If you need any more info just shout.

Many Thanks

Recommended Answers

All 2 Replies

There may be a better way. .Net Remoting

Another one is Windows Communication Foundation

if you're adamant about using sockets, then send the method you would like to run as a string at the beginning of the stream, then at the other end use Reflection to call the method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.