C 設定電腦時間幫助類

2022-01-19 19:12:56 字數 1399 閱讀 3981

using system;

using system.collections.generic;

using system.diagnostics;

using system.linq;

using system.text;

using system.threading.tasks;

--", year, month, day);

//關閉shell的使用

p.startinfo.useshellexecute = false;

//重定向標準輸入

p.startinfo.redirectstandardinput = true;

p.startinfo.redirectstandardoutput = true;

//重定向錯誤輸出

p.startinfo.redirectstandarderror = true;

//設定不顯示doc視窗

p.startinfo.createnowindow = true;

//啟動

p.start();

//從輸出流取得命令執行結果

p.standardoutput.readtoend();

}/// /// 設定本機電腦的時分秒

///

///

///

///

public static void setlocaltime(int hour, int min, int sec)

::", hour, min, sec);

//關閉shell的使用

p.startinfo.useshellexecute = false;

//重定向標準輸入

p.startinfo.redirectstandardinput = true;

p.startinfo.redirectstandardoutput = true;

//重定向錯誤輸出

p.startinfo.redirectstandarderror = true;

//設定不顯示doc視窗

p.startinfo.createnowindow = true;

//啟動

p.start();

//從輸出流取得命令執行結果

p.standardoutput.readtoend();

}/// /// 設定本機電腦的年月日和時分秒

///

///

public static void setlocaldatetime(datetime time)

}}

這個類的功能就是講伺服器上的時間同步到本地電腦然後將本地電腦時間修改為最近的時間,防止因為時間問題導致資料採集出現時效相差較大的問題

C 設定電腦時間幫助類

using system using system.collections.generic using system.diagnostics using system.linq using system.text using system.threading.tasks year,month,day...

C 時間類 時間的設定

資料成員包括 年月日小時分鐘秒 成員函式包括 年月日的設定,小時分鐘秒的設定,其中包括輸入錯誤的檢查,並提示重新的輸入 顯示函式,顯示格式按照標準格式,如2013 04 11 10 20 30 include includeusing namespace std class date class t...

C 公共幫助類 Image幫助類

大家知道,開發專案除了資料訪問層很重要外,就是common了,這裡就提供了強大且實用的工具。c 公共幫助類 convert幫助類 image類 using system using system.collections.generic using system.text using system.i...