コード例 #1
0
ファイル: MainForm.cs プロジェクト: ogvolkov/expressprofiler
 public MainForm()
 {
     InitializeComponent();
     tbStart.DefaultItem = tbRun;
     Text = versionString;
     edPassword.TextBox.PasswordChar = '*';
     m_servername = Properties.Settings.Default.ServerName;
     m_username = Properties.Settings.Default.UserName;
     m_currentsettings = GetDefaultSettings();
     ParseCommandLine();
     InitLV();
     edServer.Text = m_servername;
     edUser.Text = m_username;
     edPassword.Text = m_userpassword;
     tbAuth.SelectedIndex = String.IsNullOrEmpty(m_username) ? 0 : 1;
     if (m_autostart) RunProfiling(false);
     UpdateButtons();
 }
        //string strServerName = "";
        //string strUserName = "";
        //string strPassWord = "";
        public MainForm()
        {
            InitializeComponent();
            tbStart.DefaultItem = tbRun;
            Text = versionString;
            edPassword.TextBox.PasswordChar = '*';
            m_servername = strServerName;// Properties.Settings.Default.ServerName;//ServerName
            m_username = strUserName;// Properties.Settings.Default.UserName;//UserName
            //
            m_userpassword = strPassWord;// Properties.Settings.Default.PassWord;//PassWord
            //
            //
            //m_servername = GetAppConfig("ServerName");
            //m_username = GetAppConfig("UserName");
            //m_userpassword = GetAppConfig("PassWord");
            //
            //Type type; 
            //string strtype = type.GUID.ToString("B");
            //string filename = System.Windows.Forms.Application.ExecutablePath + ".config";
            //XmlDocument doc = new XmlDocument();
            //doc.Load(filename); //加载配置文件

            //GetXmlDataInfo.AccountConfiguration accountConfig = (GetXmlDataInfo.AccountConfiguration)ConfigurationManager.GetSection("AccountConfiguration");
            //AccountConfiguration accountConfig = (AccountConfiguration)ConfigurationManager.GetSection("AccountConfiguration");
            //Console.WriteLine(accountConfig.Users.UserName);
            //
            m_currentsettings = GetDefaultSettings();
            ParseCommandLine();
            InitLV();
            edServer.Text = m_servername;
            edUser.Text = m_username;
            edPassword.Text = m_userpassword;
            edDatabaseName.Text = m_userDataBaseName;
            edHostName.Text = m_userHostName;

            tbAuth.SelectedIndex = String.IsNullOrEmpty(m_username)?0:1;
            if(m_autostart) RunProfiling(false);
            UpdateButtons();
            //var conn = Mysoft.CgZtbMap.Common.Data.MyDataBaseManager.GetDataBase().ConnectionString;
            //server=10.5.10.76\sql2008r2;uid=team_cp;pwd=95938;database=CzStandard_dotnet_erp306
            
            //加载数据配置HostUrl标识
            LoadHostCombox();
            cbbSPID.Items.Add("");//加载空进程(查询所有SPID)

            //默认加载第一个数据库信息节点
            LoadHostDefault();
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: ogvolkov/expressprofiler
 internal void RunProfiling(bool showfilters)
 {
     if (showfilters)
     {
         TraceProperties.TraceSettings ts = m_currentsettings.GetCopy();
         using (TraceProperties frm = new TraceProperties())
         {
             frm.SetSettings(ts);
             if (DialogResult.OK != frm.ShowDialog()) return;
             m_currentsettings = frm.m_currentsettings.GetCopy();
         }
     }
     StartProfiling();
 }
        internal void RunProfiling(bool showfilters)
        {
            if (showfilters)
            {
                TraceProperties.TraceSettings ts = m_currentsettings.GetCopy();
                using (TraceProperties frm = new TraceProperties())
                {
                    frm.SetSettings(ts);
                    if (DialogResult.OK != frm.ShowDialog()) return;
                    m_currentsettings = frm.m_currentsettings.GetCopy();
                }
            }
            //

            
            StartProfiling();

            cbbHost.Enabled = false;
            edDatabaseName.Enabled = false;
            edHostName.Enabled = false;
            btnSaveConfig.Enabled = false;
            //进程只能在运行时使用
            cbbSPID.Enabled = true;
            btnCurrentSPID.Enabled = true;
        }