void Login() { lock (this.thisLock) { //GU.SetControlVisible(this.lblLoginLog, true); //Thread.Sleep(100); SRLogin.SRLoginResultType loginResultType = SRLogin.SRLoginResultType.NoInstall; try { //ClientWebService client = new ClientWebService(); SRLogin login = new SRLogin(); Param.Loginname = this.pristrUsername; Param.Pwd = this.pristrPwd; loginResultType = login.ValidateUserAndSetSession(this.pristrUsername, this.pristrPwd); SR_WordbookEntity wordbookEnt = DataBase.Instance.tSR_Wordbook.Get_Entity(String.Format(" title like [$Title$] "), new DataParameter("Title", "\\\\" + this.pristrServer + "%")); if (wordbookEnt == null) { loginResultType = SRLogin.SRLoginResultType.NoServer; } try { using (new IdentityScope(wordbookEnt.Description, wordbookEnt.Remark, wordbookEnt.Title)) { // new DirectoryInfo(wordbookEnt.Title).GetFiles(); } } catch (Exception) { loginResultType = SRLogin.SRLoginResultType.ConectServerFaile; } Param.IP = this.pristrServer; Param.ServerIP = wordbookEnt; Param.ServerCacheIP = @"\\" + Param.IP + "\\Cache"; Thread t = new Thread(new ThreadStart(BackgroudLoadingImage)); t.Start(); } catch (Exception) { loginResultType = SRLogin.SRLoginResultType.NoInstall; } this.priSRLoginResultType = loginResultType; _event.Set(); } }