void bwLogin_DoWork(object sender, DoWorkEventArgs e) { this.btnTestStatus.Invoke(new MethodInvoker(delegate() { iPublish = _Class.Utility.GetIPublishByName(this.cmbPublishName.Text); iPublish.Publish_OutResult = OPR_SendData; iPublish.Publish_Type = PublishType.Login; iPublish.Publish_Init(this.txtWebSiteUrl.Text, this.txtWebSiteLoginUrl.Text, this.txtLoginUserName.Text, this.txtLoginUserPwd.Text, 0, string.Empty); iPublish.Publish_Login(); this.btnTestStatus.Enabled = true; })); }