问题描述
我写一个非常具有挑战性的应用程序
只是想知道有人可以帮助我解决我遇到的问题
我正在编写的应用程序必须进行备份
网络如下
应用程序在服务器上
它要复制的文件在pc1上
文件必须复制到pc2
并且必须先在pc1上停止SQL Server,然后才能完成备份
即时通讯使用代码
hi people i have a very challenging application to write
just wondering of someone can help me with a problem i''m having
the application i''m writing must do backups
the network is as follows
the applications is on a server
the files it has to copy is on pc1
the files has to be copies to pc2
and the SQL Server needs to be stopped on pc1 before the backups can be done
im using the code
private ServiceController GetService()
{
return new ServiceController((string)"MSSQLSERVER");
}
停止按钮上的onclick事件
the onclick event on the stop button
System.ServiceProcess.ServiceController controller = GetService();
controller.Stop();
WaitForStatus( controller, ServiceControllerStatus.Stopped, new TimeSpan( 0,1,0) );
stStatus.Text = "Status: " + controller.Status.ToString();
btnStart.Enabled = false;
btnBackup.Enabled = true;
btnStop.Enabled = false;
停止本地SQL服务器,现在我想知道如何将代码从服务器上停止在pc1上?
想知道如何通过服务器将文件从第一台PC复制到第二台PC?
请回答会很好:D
好的,那么我该如何更改代码以进行远程操作
此应用程序只是一个普通的Windows应用程序,不是服务客户端,只是一个独立的应用程序
那么是否仍然可以复制文件,或者您是否需要服务器客户端结构?该应用程序将仅在服务器上运行,而不在pcs
to stop the local SQL server and now i wonder how the code will look to stop it on pc1 from the server?
and wondering how to copy the files from the first pc to the second pc via the server?
please answers will be nice :D
ok so how do i alter the code to do it remotely
this application is only a normal windows app not a service client only a stand alone application
is it then still possible to copy files or do you need the server client structure for that? the application is going to run on only the server and not on the pcs
推荐答案
这篇关于SQL Server停止使用C#并复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!