示例#1
0
        static void Main()
        {
            UpdateWcfServiceClient client = new UpdateWcfServiceClient();

            client.InnerChannel.OperationTimeout = TimeSpan.FromMinutes(5);
            string appToOpen = "";

            try {
                client.Open();
                appToOpen = client.DoUpdate(Application.StartupPath);
                client.Close();
            } catch (Exception ex)
            {
                MessageBox.Show(@"Error: " + CombineMessages(ex));
            }
            if (string.IsNullOrEmpty(appToOpen))
            {
                return;
            }

            if (!File.Exists(appToOpen))
            {
                return;
            }

            Process exe = new Process {
                StartInfo = { FileName = appToOpen }
            };

            exe.Start();
        }
示例#2
0
        static void Main(string[] args)
        {
            UpdateWcfServiceClient client = new UpdateWcfServiceClient();

            client.Open();
            Console.WriteLine(client.DoUpdate("C:\\Temp\\freshmpdb"));
            client.Close();
            Console.ReadLine();
        }