private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
pictureBox1.Location = new System.Drawing.Point(0, 0);
pictureBox1.Size = new System.Drawing.Size(229, 176);
pictureBox1.TabIndex = 1;
pictureBox1.TabStop = false;
pictureBox1.Tag = "0";
handle = pictureBox1.Handle;
disConnect = new fDisConnect(DisConnectEvent);
DHClient.DHInit(disConnect, IntPtr.Zero);
DHClient.DHSetEncoding(LANGUAGE_ENCODING.gb2312);
NET_DEVICEINFO info = new NET_DEVICEINFO();
ID = DHClient.DHLogin("10.1.50.243", 37777, "admin", "admin", out info, out error);
isLogin = DHClient.DHStartListen(ID);
RealHandle = DHClient.DHRealPlay(ID, 0, handle);
cbRealData = new fRealDataCallBack(cbRealDataFun);
//isSave = DHClient.DHStartSaveRealData(RealHandle, "D:/1.dav");
//pictureBox1.Show();
pictureBox1.Refresh();
if (isLogin)
{
MessageBox.Show(string.Format("Login True!"));
}
else
{
MessageBox.Show(string.Format("Login False!"));
}
if (RealHandle == 0)
{
MessageBox.Show(string.Format("Play False!"));
}
else
{
MessageBox.Show(string.Format("Play True!"));
}
if (DHClient.DHSetRealDataCallBack(RealHandle, cbRealData, IntPtr.Zero) == true)//设置数据回调处理函数
{
MessageBox.Show("设置数据回调处理函数成功!");
}
else
{
MessageBox.Show("设置数据回调处理函数失败!");
return;
}
if (isSave)
{
MessageBox.Show(string.Format("Save True!"));
}
else
{
MessageBox.Show(string.Format("Save False!"));
}
}