public void SN(string code) { string ret = string.Empty; ret = RegService.GetRegCode(code); this.Response.Write(ret); }
public Frmrecord() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); reg = new RegService(); reg.Timeout = 300000; // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // }
public Frmrecord() { // // Windows ���������֧��������� // InitializeComponent(); reg = new RegService(); reg.Timeout = 300000; // // TODO: �� InitializeComponent ���ú�����κι��캯������ // }
protected void btnSave_Click(object sender, EventArgs e) { RegService rg = new RegService(); BOOKGRAMEntities db = new BOOKGRAMEntities(); Person newSupporter = new Person(); newSupporter.FirstName = txtboxName.Text; newSupporter.LastName = txtboxSurname.Text; newSupporter.Email = txtboxEmail.Text; newSupporter.BirthDate = Convert.ToDateTime(txtboxDate.Text); newSupporter.City = txtboxAddress.Text; newSupporter.Friend_num = 0; //HIDEYI SOR newSupporter.IsActive = true; newSupporter.Post_num = 0; newSupporter.Message_num = 0; newSupporter.Username = txtboxUsername.Text; newSupporter.Friend_num = 0; newSupporter.Password = rg.makePersonPassword(txtboxPass.Text); if (fuLogoUp.HasFile) { fuLogoUp.SaveAs(Server.MapPath("~/Logos/" + fuLogoUp.FileName)); } newSupporter.Imagepath = "~/Logos/" + fuLogoUp.FileName; if (chcBox.Checked == true) { newSupporter.Hide = true; } else { newSupporter.Hide = false; } db.Person.Add(newSupporter); db.SaveChanges(); Response.Redirect("Register.aspx"); }
/// <summary> /// constructor; initializes subcomponents /// </summary> public ClientHandler() { _WebserviceSender = new ClientSender(); _WebserviceSender.OnHelloSuccessfullEvent += _WebserviceSender_OnHelloSuccessfullEvent; _WebserviceSender.OnConfigSuccessfullEvent += _WebserviceSender_OnConfigSuccessfullEvent; _WebserviceSender.OnErrorEvent += ErrorMessageHandler; _RegistrationService = new RegService(); _RegistrationService.RequestHelloEvent += _RegistrationService_RequestHelloEvent; _RegistrationService.initialize(); _WebserviceListener = new ClientListener(); ClientDefinition.OnConfigRequestEvent += ClientDefinition_OnConfigRequestEvent; ClientDefinition.ErrorMessageEvent += ErrorMessageHandler; ClientDefinition.OnScanRequestEvent += ClientDefinition_OnScanRequestEvent; ClientDefinition.OnPingEvent += ClientDefinition_OnPingEvent; ClientDefinition.OnShutdownRequestEvent += ClientDefinition_OnShutdownRequestEvent; _WebserviceListener.initialize(ConfigManager._ClientConfigObject.clientConnectionConfig.listeningPort); LogManager.writeLog("[Webservice] Webservice fully initialized"); }
/// <summary> /// 输入包输入回调 /// </summary> /// <param name="data"></param> /// <param name="socketAsync"></param> private void RegServer_BinaryInput(byte[] data, SocketAsyncEventArgs socketAsync) { try { if (socketAsync.AcceptSocket != null) { ReadBytes read = new ReadBytes(data); int length; int Cmd; long key; int netport; if (read.ReadInt32(out length) && length == read.Length && read.ReadInt32(out Cmd) && read.ReadInt64(out key) && read.ReadInt32(out netport)) { if (Cmd == 100) { string ip = ((IPEndPoint)socketAsync.AcceptSocket.RemoteEndPoint).Address.ToString(); //获取外网IP地址 int port = int.Parse(((IPEndPoint)socketAsync.AcceptSocket.RemoteEndPoint).Port.ToString()); //获取端口号 if (SessionDiy.ContainsKey(key)) //检查是否包含此KEY { SessionDiy[key].WANIP = ip; SessionDiy[key].WANPort = port; SessionDiy[key].NatNextPort = netport - 1; LLOG(string.Format("注册端口号: 客户端Id: {0} 外网IP地址: {1}:{3} 下次开放端口: {2}", key, ip, netport, port), EventLogType.INFO); RegService.SendData(socketAsync.AcceptSocket, new byte[] { 1 }); } } } } } catch (Exception er) { LLOG(er.ToString(), EventLogType.ERR); } }
public RegController(RegService regService) { this.regService = regService; }
public RegController(RegService context) { _registrationContext = context; }