I have created a consol application project in c# as my server and a windows application project in c# as my client.
In case an exception accourse during remoting an object, I want my server to send a message to a client. I want this message will be shown in a messagebox on the client side.
I have no idea how to send a message from a server to a client.
here is the code of the remoting object:
Expand|Select|Wrap|Line Numbers
- public String lookup(String name)
- {
- try
- {
- StreamReader SR;
- SR = File.OpenText("c:\\Yellow Page.txt");
- String S = "test";
- while (S != null)
- {
- String read = SR.ReadLine();
- if (read.Substring(0, name.Length).Equals(name))
- {
- String address = read.Substring(name.Length);
- SR.Close();
- return address;
- }
- }
- }
- catch (Exception e)
- {
- Console.Out.WriteLine("No Match for " + name + " found: "+ e);
- }
Any recommendations?
Thanx