Host에 있는 Script file등을 Process.Start로 실행시켜 보자.
#region "서버로 접근하여 특정 파일 실행시키기 : ExecuteServerFile"
/// ////////////////////////////////////////////////////////////
/// Makeby : HJKIM@FROM30 200900903
/// FuncName: StartHostFile
/// review : This function can start from server which is USER decide.
/// apply : System.Diagnostics.Process.Start function user method,
/// ////////////////////////////////////////////////////////////
public bool StartHostFile(string strServerFile)
{
// 1. check target
string target=null;
if (strServerFile.Contains("/"))
target = AdjustDir(strServerFile);
string strArgument = string.Format("/c rsh {0} -l {1} {2}", axSinfo.hostname, axSinfo.userid, target);
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = strArgument;
Process.Start(startInfo);
//System.Diagnostics.Process.Start("cmd.exe",strAgument);
return true;
}
#endregion
'프로그래밍 > .Net' 카테고리의 다른 글
자신의 PC IP 얻어오기(local pc ip ) (0) | 2014.01.17 |
---|---|
User Control Event 사용(delegate, event) (0) | 2014.01.17 |
ftp protocol을 이용하여 지정된 host에 파일 업로드 하기(ftp upload) (0) | 2014.01.17 |
ftp protocol을 이용하여 지정된 host로부터 파일 다운로드 하기(ftp download) (0) | 2014.01.17 |
Control Attribute 컨트롤 속성 변경하기(get/set) (0) | 2014.01.17 |