private void Form1_Load(object sender, EventArgs e) { Tools.SetDoubleBuf(dataGridView1, true); Tools.Grid_OutoSize(dataGridView1); this.webBrowser1.DocumentText = string.Empty; this.webBrowser1.Document.ExecCommand("EditMode", false, null); this.webBrowser1.Document.ExecCommand("LiveResize", false, null); webBrowser1.Url = new Uri(Value.PathMail + Ini.Read("HtmlPath")); textBox1.Text = Ini.Read("MailTitle"); fileSystemWatcher1.Path = Value.PathMail; textBox2.Text = Ini.Read("附件路径"); if (Tools.GetFileSize(Value.PathWork + Ini.Read("MailPath")) > 10000) { MessageBox.Show("任务文件过大,避免卡机,建议启动后手动加载!", "提示"); } else { DataSave.GetDataFromFile(Value.PathWork + Ini.Read("MailPath"), dataGridView1); } if (Ini.Read("自动登陆") == "是") { toolStripLabel2.Text = "正在登陆"; } Ini.Write("RecordPath", "Record.DLL"); ThreadSend TS = new ThreadSend(null, 0);//加载消息 TS.OnReceivedData += new ThreadSend.ReceivedData(Thread_OnReceivedData); new Thread(new ThreadStart(TS.Func)).Start(); }
private void 打开OToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog Dlg = new OpenFileDialog(); Dlg.InitialDirectory = Value.PathWork; Dlg.DefaultExt = "CSV"; Dlg.Filter = "CSV文件(*.CSV)|*.CSV"; if (Dlg.ShowDialog() == DialogResult.Cancel) { return; } DataSave.GetDataFromFile(Dlg.FileName, dataGridView1); Ini.Write("MailPath", Path.GetFileName(Dlg.FileName)); this.Text = Dlg.FileName + Value.SoftName + "(" + Value.LoginUserName + ")"; }