Click here to Skip to main content
16,006,605 members
Home / Discussions / C#
   

C#

 
GeneralRe: Coding Style Question Pin
leppie15-Apr-08 6:01
leppie15-Apr-08 6:01 
GeneralRe: Coding Style Question Pin
Brady Kelly15-Apr-08 6:16
Brady Kelly15-Apr-08 6:16 
GeneralRe: Coding Style Question Pin
Judah Gabriel Himango15-Apr-08 6:25
sponsorJudah Gabriel Himango15-Apr-08 6:25 
GeneralRe: Coding Style Question Pin
Luc Pattyn15-Apr-08 6:42
sitebuilderLuc Pattyn15-Apr-08 6:42 
GeneralRe: Coding Style Question Pin
PIEBALDconsult15-Apr-08 11:39
mvePIEBALDconsult15-Apr-08 11:39 
GeneralRe: Coding Style Question Pin
Waleed Eissa15-Apr-08 21:33
Waleed Eissa15-Apr-08 21:33 
QuestionOutlook like user control (the TextBox where you can enter the e-mail adresses) Pin
Member 188831515-Apr-08 4:26
Member 188831515-Apr-08 4:26 
QuestionRemoting issues - how? Pin
bluescreen7615-Apr-08 4:17
bluescreen7615-Apr-08 4:17 
Hello all,

This is my first post. Sorry in advance for any stupid questions.

I would like to develop an application which restart a process on a remote computer. I have noticed that I would actually 2 applications: 1) a server (listener) on the remote target PC, 2) a client which will initiate and connect to the server and pass the name of the service to restart.

I have developed a tested the application on the server side:

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Diagnostics;<br />
using System.Threading;<br />
using System.ServiceProcess;<br />
<br />
namespace RestartProcess<br />
{<br />
    class Program<br />
    {<br />
        static void Main(string[] args)<br />
        {<br />
            RestartService("MY SERVICE TO RESTART");<br />
        }<br />
<br />
        private static void RestartService (string name)<br />
        {<br />
            ServiceController service = new ServiceController(name);<br />
            service.Stop();<br />
            Thread.Sleep(1000);<br />
            service.Start();<br />
            Thread.Sleep(1000);<br />
        }<br />
<br />
    }<br />
}<br />


but I don't know how to connect to this process from the client side. Remoting?

Thanks for supplying an easy sample.


Regards,
AnswerRe: Remoting issues - how? Pin
leppie15-Apr-08 4:19
leppie15-Apr-08 4:19 
GeneralRe: Remoting issues - how? Pin
bluescreen7615-Apr-08 4:37
bluescreen7615-Apr-08 4:37 
GeneralRe: Remoting issues - how? Pin
Judah Gabriel Himango15-Apr-08 6:13
sponsorJudah Gabriel Himango15-Apr-08 6:13 
QuestionExporting html data to Excel [modified] Pin
basi001415-Apr-08 4:14
basi001415-Apr-08 4:14 
GeneralRe: Exporting html data to Excel Pin
Waleed Eissa15-Apr-08 4:44
Waleed Eissa15-Apr-08 4:44 
GeneralRe: Exporting html data to Excel Pin
basi001415-Apr-08 4:50
basi001415-Apr-08 4:50 
GeneralRe: Exporting html data to Excel Pin
Waleed Eissa15-Apr-08 5:05
Waleed Eissa15-Apr-08 5:05 
GeneralRe: Exporting html data to Excel Pin
basi001415-Apr-08 5:35
basi001415-Apr-08 5:35 
GeneralRe: Exporting html data to Excel [modified] Pin
Waleed Eissa15-Apr-08 5:52
Waleed Eissa15-Apr-08 5:52 
GeneralRe: Exporting html data to Excel Pin
basi001415-Apr-08 7:26
basi001415-Apr-08 7:26 
GeneralRe: Exporting html data to Excel Pin
Waleed Eissa15-Apr-08 21:27
Waleed Eissa15-Apr-08 21:27 
GeneralRe: Exporting html data to Excel Pin
basi001416-Apr-08 5:04
basi001416-Apr-08 5:04 
GeneralRe: Exporting html data to Excel Pin
Waleed Eissa16-Apr-08 14:37
Waleed Eissa16-Apr-08 14:37 
GeneralRe: Exporting html data to Excel Pin
Waleed Eissa16-Apr-08 14:42
Waleed Eissa16-Apr-08 14:42 
GeneralRe: Exporting html data to Excel Pin
sarvesh.upadhyay16-Apr-08 1:54
professionalsarvesh.upadhyay16-Apr-08 1:54 
GeneralSuppressFinalize Pin
George_George15-Apr-08 4:10
George_George15-Apr-08 4:10 
GeneralRe: SuppressFinalize Pin
Zoltan Balazs15-Apr-08 4:19
Zoltan Balazs15-Apr-08 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.