示例#1
0
        public AccountRequest(DataPackage data)
        {
            SQLService sql = new SQLService();
            dataResponse.Client = data.Client;

            LoginData loginData = convert.ConvertToClass(data.Data);
            loginData.User_id = sql.AccountRequest(loginData.User_password);

            dataResponse.Data = convert.ConvertToBytes(loginData);
            FileCheck fileCheck = new FileCheck();
            fileCheck.CheckCreateUserDir(loginData.User_id);
        }
示例#2
0
 public bool Receive()
 {
     Newtalking_DAL_Server.ReceiveFile rece = new Newtalking_DAL_Server.ReceiveFile(remoteClient);
     FileCheck fileCheck = new FileCheck();
     string[] strs = fileCheck.CheckCreateUserDir(rfr.User_id);
     WriteFile writer = new WriteFile(strs[0]);
     try {
         byte[] data;
         do
         {
             data = rece.Receive();
             writer.Write(data);
         } while (data.Length == 1024);
         writer.fileStream.Close();
         return true;
     }
     catch
     {
         writer.Delete();
         return false;
     }
 }