using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Reflection; namespace WindowsFormsApplication2 { public class UserAgentHelper { priva…
1.第一种,不安全,当线程过多后,timer控件和线程中同时访问窗体控件时,有时会出现界面重绘出错. public frmMain() { InitializeComponent(); System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls =false; } 2.避免繁复的delegate,Invoke,转载,不推荐使用 public static class ControlCrossThreadCalls { public d…