1. 建立数据库和表(参考SQL Server中的建立数据库)
2. 日志写入数据库(本地+远程)实例
function Pick1_CommandExecuted(sender : System.Object, cmdArgs : Ico.Gwx.CommandExecutionEventArgs)
{
var userNameText = "Tester";
//MessageBox.Show(userNameText);
AddOpLogToDB(userNameText, "开关切除");
}
function Pick2_CommandExecuted(sender : System.Object, cmdArgs : Ico.Gwx.CommandExecutionEventArgs)
{
var userNameText = "Tester";
AddOpLogToDB(userNameText, "开关恢复");
}
function AddOpLogToDB(userNameText, infoText)
{
var logTime : Ico.Gwx.GwxLabel = ThisConfiguration.GetObjectByName("时间");
var sqlCmd;
sqlCmd = "INSERT INTO ABCDE.dbo.Operation_Log(OpDate, UserName, Information) VALUES ('" + logTime.Text + "','" + userNameText + "