コード例 #1
0
        public void Start(ServerDLL._ServerType serverType, string port)
        {
            bool      load = true;
            AppDomain workerAppDomain;
            ParameterizedThreadStart thStrat = new ParameterizedThreadStart(LoadServerDll);

            object[] args        = { 2, port };
            Thread   childThread = new Thread(thStrat);

            Thread.Sleep(6000);
            while (true)
            {
                if (load)
                {
                    load = false;
                    GetLatestDll(@"\\risinas\Temp\Mark\ServerDLL.dll");
                    childThread.Start(args);
                }

                Thread.Sleep(6000);

                if (IsNewDLLAvailable(@"\\risinas\Temp\Mark\ServerDLL.dll"))
                {
                    Process notePad = new Process();

                    notePad.StartInfo.FileName = @"ServerWindowsInterface.exe";
                    notePad.Start();
                    UnLoadDomain();
                    workerAppDomain = null;
                    Process.GetCurrentProcess().Kill();
                }
            }
        }
コード例 #2
0
 public void StartDirectly(ServerDLL._ServerType serverType, string port)
 {
     ServerDLL.Server server = new ServerDLL.Server();
     server.Start((int)serverType, port);
 }