Ask the Expert

Getting data from a project to a class file and Windows service

I have two separate projects. In the first project, I have a form. In the second, I have a class file and Windows service. Is it possible to get data of the form that is in the first project to that Windows Service? If this is not possible, please tell me how to get the value from that form to a class file.
Windows services can expose a remoting server object at a Uri, say tcp://localhost/MyService.rem. The Windows Form can create a new instance of this "remote" object and call a method on it, passing the form data. The method is executed on the service application, where you can do whatever you need. You can start at MSDN on how to expose the remote object, how to configure the "server" (the windows service) and client application (the "form"):

  • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/hawkremoting.asp
  • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/hawkremoting.asp

    Other interesting introductory articles are:

  • http://www.codeproject.com/csharp/DotNetRemotingBasicTutor.asp?target=remoting
  • http://www.codeproject.com/vb/net/RemotingTech.asp?target=remoting

    This was first published in March 2004

  • There are Comments. Add yours.

     
    TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

    REGISTER or login:

    Forgot Password?
    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
    Sort by: OldestNewest

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to: