//private void CaptureJpeg() //{ // string sJpegPicFileName; // //ͼƬ±£´æ·¾¶ºÍÎļþÃû the path and file name to save // sJpegPicFileName = "JPEG_test.jpg"; // int lChannel = Int16.Parse(dvrControl.dvrObject.Channel); //ͨµÀºÅ Channel number // CHCNetSDK.NET_DVR_JPEGPARA lpJpegPara = new CHCNetSDK.NET_DVR_JPEGPARA(); // lpJpegPara.wPicQuality = 0; //ͼÏñÖÊÁ¿ Image quality // lpJpegPara.wPicSize = 0xff; //ץͼ·Ö±æÂÊ Picture size: 2- 4CIF£¬0xff- Auto(ʹÓõ±Ç°ÂëÁ÷·Ö±æÂÊ)£¬×¥Í¼·Ö±æÂÊÐèÒªÉ豸֧³Ö£¬¸ü¶àÈ¡ÖµÇë²Î¿¼SDKÎĵµ // //JPEGץͼ Capture a JPEG picture // if (!CHCNetSDK.NET_DVR_CaptureJPEGPicture(m_lUserID, lChannel, ref lpJpegPara, sJpegPicFileName)) // { // //fail capture // iLastErr = CHCNetSDK.NET_DVR_GetLastError(); // str = "NET_DVR_CaptureJPEGPicture failed, error code= " + iLastErr; // //MessageBox.Show(str); // return; // } // else // { // //success capture // str = "Successful to capture the JPEG file and the saved file is " + sJpegPicFileName; // //MessageBox.Show(str); // } // return; //} #endregion private void OpenSetting(object sender, MouseButtonEventArgs e) { SigninWindow signinWindow = new SigninWindow(); signinWindow.ShowDialog(); if (signinWindow.Loginstatus) { SettingWindow settingWindow = new SettingWindow(); settingWindow.ShowDialog(); } }
private void MainWindow_Load(object sender, EventArgs e) { try { conn = new SqlConnection(); conn.ConnectionString = "Server=localhost; Database=DBAS; Integrated Security=true"; conn.Open(); } catch (Exception ex) { if (MessageBox.Show(ex.Message + "\r\n是否继续?", "数据访问错误", MessageBoxButtons.YesNo) == DialogResult.No) { this.Close(); } } SigninWindow win = new SigninWindow(this, conn); if (win.ShowDialog() != DialogResult.OK) { Application.Exit(); } NavTreeTool.RefreshByDbConnection(treeView1, CMSTreeNode, conn); }