//public RequestMessageFormat<List<UserCurrentRequestStatusDTO>> GetByStatus(string status) //{ // List<UserCurrentRequestStatus> userCurrentRequestStatusList = new List<UserCurrentRequestStatus>(); // if(status=="declined") // { // userCurrentRequestStatusList = this.UserCurrentRequestStatusRepository.List.Find((item) => item.UserRequestType == UserRequestStatusType.Pending); // } // else if(status=="pending") // { // }if(status=="approved") // { // } // List<UserCurrentRequestStatusDTO> userCurrentRequestStatusDTOList = this.AutoMapperConfigurations.UserCurrentRequestStatusListToUserCurrentRequestStatusDTOList(userCurrentRequestStatusList); // RequestMessageFormat<List<UserCurrentRequestStatusDTO>> response = new RequestMessageFormat<List<UserCurrentRequestStatusDTO>>(); // if (userCurrentRequestStatusList.Count == 0) // { // response.Data = null; // response.Success = false; // response.Message = "Empty List"; // } // else // { // response.Data = userCurrentRequestStatusDTOList; // response.Success = true; // response.Message = "Data fetched successfully"; // } // return response; //} public RequestMessageFormat <UserCurrentRequestStatusDTO> GetById(int id) { RequestMessageFormat <UserCurrentRequestStatusDTO> response = new RequestMessageFormat <UserCurrentRequestStatusDTO>(); try { UserCurrentRequestStatus userCurrentRequestStatus = this.UserCurrentRequestStatusRepository.FindById(id); UserCurrentRequestStatusDTO userCurrentRequestStatusDTO = this.AutoMapperConfigurations.UserCurrentRequestStatusToUserCurrentRequestStatusDTO(userCurrentRequestStatus); if (userCurrentRequestStatus == null) { response.Data = null; response.Success = false; response.Message = "House Not Found"; return(response); } else { response.Data = userCurrentRequestStatusDTO; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while deleting data. Please try again"; response.Success = false; response.Data = null; return(response); } }
public RequestMessageFormat <List <HouseMemberDTO> > GetAll() { RequestMessageFormat <List <HouseMemberDTO> > response = new RequestMessageFormat <List <HouseMemberDTO> >(); try { List <HouseMember> houseMembers = this.HouseMemberRepository.List; List <HouseMemberDTO> houseMemberDTOList = this.AutoMapperConfigurations.HouseMemberListToHouseMemberDTOList(houseMembers); if (houseMembers.Count == 0) { response.Data = null; response.Success = false; response.Message = "Empty List"; return(response); } else { response.Data = houseMemberDTOList; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while deleting data. Please try again"; response.Success = false; response.Data = null; return(response); } }
public RequestMessageFormat <HouseDTO> GetById(int id) { RequestMessageFormat <HouseDTO> response = new RequestMessageFormat <HouseDTO>(); try { House house = this.HouseRepository.FindById(id); HouseDTO houseDTO = this.AutoMapperConfigurations.HouseToHouseDTO(house); if (house == null) { response.Data = null; response.Success = false; response.Message = "House Not Found"; return(response); } else { response.Data = houseDTO; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Data = null; response.Success = false; response.Message = "Database Error please try again"; return(response); } }
public RequestMessageFormat <UserCurrentRequestStatusDTO> Add(UserCurrentRequestStatusDTO userCurrentRequestStatusDTO) { RequestMessageFormat <UserCurrentRequestStatusDTO> response = new RequestMessageFormat <UserCurrentRequestStatusDTO>(); try { userCurrentRequestStatusDTO.CreatedOn = DateTime.Now; userCurrentRequestStatusDTO.ModifiedOn = DateTime.Now; UserCurrentRequestStatus userCurrentRequestStatus = this.AutoMapperConfigurations.UserCurrentRequestStatusDTOToUserCurrentRequestStatus(userCurrentRequestStatusDTO); bool isAdded = this.UserCurrentRequestStatusRepository.Add(userCurrentRequestStatus); if (isAdded) { response.Message = "Added Successfully"; userCurrentRequestStatusDTO.ID = userCurrentRequestStatus.ID; response.Data = userCurrentRequestStatusDTO; response.Success = true; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while adding data please try again"; response.Data = null; response.Success = false; return(response); } return(response); }
public RequestMessageFormat <UserDTO> GetById(int id) { RequestMessageFormat <UserDTO> response = new RequestMessageFormat <UserDTO>(); try { User user = this.UserRepository.FindById(id); UserDTO userDTO = this.AutoMapperConfigurations.UserToUserDTO(user); if (user == null) { response.Data = null; response.Success = false; response.Message = "User Not Found"; } else { response.Data = userDTO; response.Success = true; response.Message = "Data fetched successfully"; } } catch (Exception) { response.Data = null; response.Success = false; response.Message = "Error in database , please try again"; return(response); } return(response); }
public RequestMessageFormat <HouseMemberDTO> GetById(int id) { RequestMessageFormat <HouseMemberDTO> response = new RequestMessageFormat <HouseMemberDTO>(); try { HouseMember houseMember = this.HouseMemberRepository.FindById(id); HouseMemberDTO houseMemberDTO = this.AutoMapperConfigurations.HouseMemberToHouseMemberDTO(houseMember); if (houseMember == null) { response.Data = null; response.Success = false; response.Message = "House Member Not Found"; return(response); } else { response.Data = houseMemberDTO; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while deleting data. Please try again"; response.Success = false; response.Data = null; return(response); } }
public RequestMessageFormat <UserDTO> Update(UserDTO userDTO) { RequestMessageFormat <UserDTO> response = new RequestMessageFormat <UserDTO>(); try { userDTO.ModifiedOn = DateTime.Now; User user = this.AutoMapperConfigurations.UserDTOToUser(userDTO); bool isUpdated = this.UserRepository.Update(user); if (isUpdated) { response.Message = "Updated Successfully"; response.Data = userDTO; response.Success = true; return(response); } } catch (Exception) { response.Message = "Some Database error ,please try again..."; response.Data = null; response.Success = false; return(response); } return(response); }
//todo //private void RefreshUserList() //{ // if (this.UserCacheList == null) // { // this.UserCacheList = this.UserRepository.List; // } //} public RequestMessageFormat <List <UserDTO> > GetAll() { RequestMessageFormat <List <UserDTO> > response = new RequestMessageFormat <List <UserDTO> >(); try { List <User> users = this.UserRepository.List; List <UserDTO> userDTOList = this.AutoMapperConfigurations.UserListToUserDTOList(users); if (users.Count == 0) { response.Data = null; response.Success = false; response.Message = "Empty List"; return(response); } else { response.Data = userDTOList; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Data = null; response.Success = false; response.Message = "Error in database , please try again"; return(response); } }
RequestMessageFormat <List <HouseDTO> > IHouseBusinessLayer.GetAll() { RequestMessageFormat <List <HouseDTO> > response = new RequestMessageFormat <List <HouseDTO> >(); try { List <House> houses = this.HouseRepository.List; List <HouseDTO> houseDTOList = this.AutoMapperConfigurations.HouseListToHouseDTOList(houses); if (houses.Count == 0) { response.Data = null; response.Success = false; response.Message = "Empty List"; return(response); } else { response.Data = houseDTOList; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Data = null; response.Success = false; response.Message = "Database Error please try again"; return(response); } }
public override int GetHashCode() { int hash = 1; if (Topic.Length != 0) { hash ^= Topic.GetHashCode(); } if (RequestMessageFormat.Length != 0) { hash ^= RequestMessageFormat.GetHashCode(); } if (ResponseMessageFormat.Length != 0) { hash ^= ResponseMessageFormat.GetHashCode(); } hash ^= tags_.GetHashCode(); if (Description.Length != 0) { hash ^= Description.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public HttpResponseMessage GetAll() { RequestMessageFormat <List <UserDTO> > tempResponse = this.UserBusinessLogic.GetAll(); List <UserDTO> userList = tempResponse.Data; if (userList != null) { int length = userList.Count; for (int i = 0; i < length; ++i) { userList[i].ProfileImage = getImage(userList[i].ProfileImage); } } RequestMessageFormat <List <UserDTO> > response = new RequestMessageFormat <List <UserDTO> >(); response.Data = userList; response.Message = tempResponse.Message; response.Success = tempResponse.Success; // this.UserBusinessLogic.GetAll().Data = userList; return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public RequestMessageFormat <List <UserCurrentRequestStatusDTO> > GetAll() { RequestMessageFormat <List <UserCurrentRequestStatusDTO> > response = new RequestMessageFormat <List <UserCurrentRequestStatusDTO> >(); try { List <UserCurrentRequestStatus> userCurrentRequestStatusList = this.UserCurrentRequestStatusRepository.List; List <UserCurrentRequestStatusDTO> userCurrentRequestStatusDTOList = this.AutoMapperConfigurations.UserCurrentRequestStatusListToUserCurrentRequestStatusDTOList(userCurrentRequestStatusList); if (userCurrentRequestStatusList.Count == 0) { response.Data = null; response.Success = false; response.Message = "Empty List"; return(response); } else { response.Data = userCurrentRequestStatusDTOList; response.Success = true; response.Message = "Data fetched successfully"; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while deleting data. Please try again"; response.Success = false; response.Data = null; return(response); } }
public RequestMessageFormat <UserCurrentRequestStatusDTO> Update(UserCurrentRequestStatusDTO userCurrentRequestStatusDTO) { RequestMessageFormat <UserCurrentRequestStatusDTO> response = new RequestMessageFormat <UserCurrentRequestStatusDTO>(); try { userCurrentRequestStatusDTO.ModifiedOn = DateTime.Now; UserCurrentRequestStatus userCurrentRequestStatus = this.AutoMapperConfigurations.UserCurrentRequestStatusDTOToUserCurrentRequestStatus(userCurrentRequestStatusDTO); bool isUpdated = this.UserCurrentRequestStatusRepository.Update(userCurrentRequestStatus); if (isUpdated) { response.Message = "Updated Successfully"; response.Data = userCurrentRequestStatusDTO; response.Success = true; return(response); } } catch (Exception) { response.Message = "Some Error Occurred"; response.Success = false; response.Data = null; return(response); } return(response); }
public HttpResponseMessage Get(int id) { RequestMessageFormat <UserDTO> tempResponse = this.UserBusinessLogic.GetById(id); UserDTO user = tempResponse.Data; if (user != null) { user.ProfileImage = getImage(user.ProfileImage); } RequestMessageFormat <UserDTO> response = new RequestMessageFormat <UserDTO>(); response.Data = user; response.Message = tempResponse.Message; response.Success = tempResponse.Success; return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public RequestMessageFormat <HouseMemberDTO> Add(HouseMemberDTO houseMemberDTO) { RequestMessageFormat <HouseMemberDTO> response = new RequestMessageFormat <HouseMemberDTO>(); try { houseMemberDTO.CreatedOn = DateTime.Now; houseMemberDTO.ModifiedOn = DateTime.Now; if (this.CheckEmptyData(houseMemberDTO)) { response.Message = "Entered Invalid Data"; response.Data = null; response.Success = false; return(response); } HouseMember houseMember = this.AutoMapperConfigurations.HouseMemberDTOToHouseMember(houseMemberDTO); bool isAdded = this.HouseMemberRepository.Add(houseMember); if (isAdded) { response.Message = "Added Successfully"; houseMemberDTO.ID = houseMember.ID; response.Data = houseMemberDTO; response.Success = true; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while adding data please try again"; response.Data = null; response.Success = false; return(response); } return(response); }
public RequestMessageFormat <HouseMemberDTO> Delete(int id) { RequestMessageFormat <HouseMemberDTO> response = new RequestMessageFormat <HouseMemberDTO>(); try { HouseMember houseMember = this.HouseMemberRepository.FindById(id); if (houseMember == null) { response.Message = "HouseMember Not Exist"; response.Success = false; response.Data = null; return(response); } else { bool isDeleted = this.HouseMemberRepository.Delete(houseMember); if (isDeleted) { response.Message = "Deleted Successfully"; response.Success = true; response.Data = null; return(response); } } }catch (Exception) { response.Message = "Some Error Occurred while deleting data. Please try again"; response.Success = false; response.Data = null; return(response); } return(response); }
public RequestMessageFormat <UserDTO> Delete(int id) { RequestMessageFormat <UserDTO> response = new RequestMessageFormat <UserDTO>(); try { User user = this.UserRepository.FindById(id); if (user == null) { response.Message = "User Not Exist"; response.Success = false; response.Data = null; } else { bool isDeleted = this.UserRepository.Delete(user); if (isDeleted) { response.Message = "Deleted Successfully"; response.Success = true; response.Data = null; } } } catch (Exception) { response.Message = "Some database error. Please try again"; response.Success = false; response.Data = null; return(response); } return(response); }
public RequestMessageFormat <UserCurrentRequestStatusDTO> Delete(int id) { RequestMessageFormat <UserCurrentRequestStatusDTO> response = new RequestMessageFormat <UserCurrentRequestStatusDTO>(); try { UserCurrentRequestStatus userCurrentRequestStatus = this.UserCurrentRequestStatusRepository.FindById(id); if (userCurrentRequestStatus == null) { response.Message = "House Not Exist"; response.Success = false; response.Data = null; return(response); } else { bool isDeleted = this.UserCurrentRequestStatusRepository.Delete(userCurrentRequestStatus); if (isDeleted) { response.Message = "Deleted Successfully"; response.Success = true; response.Data = null; return(response); } } }catch (Exception) { response.Message = "Some Error Occurred while deleting data. Please try again"; response.Success = false; response.Data = null; return(response); } return(response); }
public RequestMessageFormat <UserDTO> Add(UserDTO userDTO) { RequestMessageFormat <UserDTO> response = new RequestMessageFormat <UserDTO>(); try { userDTO.CreatedOn = DateTime.Now; userDTO.ModifiedOn = DateTime.Now; userDTO.IsApprover = BooleanType.False; if (this.CheckEmptyData(userDTO)) { response.Message = "Entered Invalid Data"; response.Data = null; response.Success = false; return(response); } if (this.CheckDuplicateAadhar(userDTO)) { response.Message = "Aadhar Number Already Exists"; response.Data = null; response.Success = false; return(response); } if (this.CheckDuplicateEmail(userDTO)) { response.Message = "Email Already Exists"; response.Data = null; response.Success = false; return(response); } User user = this.AutoMapperConfigurations.UserDTOToUser(userDTO); bool isAdded; isAdded = this.UserRepository.Add(user); if (isAdded) { response.Message = "Added Successfully"; userDTO.ID = user.ID; UserCurrentRequestStatus userCurrentRequestStatus = new UserCurrentRequestStatus(); userCurrentRequestStatus.UserId = user.ID; userCurrentRequestStatus.UserRequestType = UserRequestStatusType.Pending; userCurrentRequestStatus.CreatedOn = DateTime.Now; userCurrentRequestStatus.ModifiedOn = DateTime.Now; this.UserCurrentRequestStatusRepository.Add(userCurrentRequestStatus); response.Data = userDTO; response.Success = true; return(response); } } catch (Exception) { response.Message = "Some Error Occurred while adding data please try again"; response.Data = null; response.Success = false; return(response); } return(response); }
public RequestMessageFormat <LoginedUserDTO> LoginUser(LoginUserDTO loginUserDTO) { RequestMessageFormat <LoginedUserDTO> response = new RequestMessageFormat <LoginedUserDTO>(); try { int count = this.UserRepository.Find(user => user.Email == loginUserDTO.Email).ToList().Count(); if (count == 0) { response.Data = null; response.Message = "No User found with this email"; response.Success = false; return(response); } else { count = 0; count = this.UserRepository.Find(user => user.Email == loginUserDTO.Email && user.Password == loginUserDTO.Password).ToList().Count(); if (count != 0) { User user = this.UserRepository.Find(theuser => theuser.Email == loginUserDTO.Email).ToList().First(); if (user.IsApprover == BooleanType.True) { LoginedUserDTO loginedUserDTO1 = this.AutoMapperConfigurations.UserToLoginedUserDTO(user); response.Data = loginedUserDTO1; response.Message = "You are successfully loggedIn"; response.Success = true; return(response); } LoginedUserDTO loginedUserDTO = this.AutoMapperConfigurations.UserToLoginedUserDTO(user); UserCurrentRequestStatus userCurrentRequestStatus = this.UserCurrentRequestStatusRepository.Find(status => status.UserId == user.ID).ToList().First(); loginedUserDTO.UserRequestStatus = userCurrentRequestStatus.UserRequestType; response.Data = loginedUserDTO; response.Message = "You are successfully loggedIn"; response.Success = true; return(response); } else { response.Data = null; response.Message = "Incorrect Password"; response.Success = false; return(response); } } } catch (Exception) { response.Message = "Some Error Occurred while adding data please try again"; response.Data = null; response.Success = false; return(response); } }
public static void StartService() { string sharedFilePathFile = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\AreaParty\sharedFilePathInfor.audio"; transferinformation.Action.readSharedFileAndParse(ref sharedFilePathFile, ref sharedFileList); System.Threading.Thread thread = new System.Threading.Thread(MonitoringSys); thread.IsBackground = true; thread.Start(); System.Threading.Thread thread1 = new System.Threading.Thread(MonitoringProcesses); thread1.IsBackground = true; thread1.Start(); System.Threading.Thread thread2 = new System.Threading.Thread(TransferMonitorData); thread2.IsBackground = true; thread2.Start(); //bool run = false; //while (!run) //{ // System.Threading.Thread thread2 = new System.Threading.Thread(TransferMonitorData); // thread2.IsBackground = true; // try // { // thread2.Start(); // run = true; // } // catch (SocketException e) // { // thread2.Abort(); // AreaParty.function.pcapp.PCApp.Close("127.0.0.1", 7777); // //thread2.Start(); // } //} IPEndPoint localIP = new IPEndPoint(IPAddress.Any, ConfigResource.PCINFO_PORT); TcpListener listener = new TcpListener(localIP); //try //{ listener.Start(); //} //catch (SocketException) //{ // //listener. // //localIP = new IPEndPoint(IPAddress.Any, ConfigResource.PCINFO_PORT); // //listener = new TcpListener(localIP); // //listener. //} Console.WriteLine("Action Server is listening..."); while (isRun) { TcpClient remoteClient = listener.AcceptTcpClient(); Console.WriteLine("Action Server is connected..."); int RecvBytes = 0; byte[] RecvBuf = new byte[1024]; string messageGet = null; try { RecvBytes = remoteClient.Client.Receive(RecvBuf); if (RecvBytes <= 0) { Console.WriteLine("Action socket 被动关闭"); continue; } messageGet = Encoding.UTF8.GetString(RecvBuf, 0, RecvBytes); Console.WriteLine("Action Message: {0}", messageGet); RequestMessageFormat request = JsonHelper.DeserializeJsonToObject <RequestMessageFormat>(messageGet); ReturnMessageFormat returnMessage = new ReturnMessageFormat(); switch (request.name) { case Order.get_areaparty_path: returnMessage.data = null; returnMessage.message = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\AreaParty\\"; returnMessage.status = 200; break; case Order.ownProgressAction_name: if (request.command == Order.ownProgressAction_Close) { StopService(); } //transferinformation.Action.CloseProcess(System.Diagnostics.Process.GetCurrentProcess().Id); break; case Order.processAction_name: if (request.command == Order.processAction_command) { returnMessage = transferinformation.Action.CloseProcess(int.Parse(request.param)); } break; case Order.computerAction_name: if (request.command == Order.computerAction_command_reboot) { transferinformation.Action.RebootComputer(); } else if (request.command == Order.computerAction_command_shutdown) { transferinformation.Action.shutdownComputer(); } break; case Order.fileAction_name: switch (request.command) { case Order.fileAction_share_command: SharedFilePathFormat sharedFile = JsonHelper.DeserializeJsonToObject <SharedFilePathFormat>(request.param); returnMessage = transferinformation.Action.AddSharedFile(ref sharedFile, ref sharedFileList, ref sharedFilePathFile); break; case Order.fileAction_open_command: { // 此处是打开文件代码 } break; case Order.fileOrFolderAction_delete_command: { // 此处是删除文件的代码 returnMessage = transferinformation.Action.DeleteFile(request.param); } break; case Order.fileOrFolderAction_rename_command: { // 此处是重命名文件的代码 string[] temp = System.Text.RegularExpressions.Regex.Split(request.param, "-PATH-", System.Text.RegularExpressions.RegexOptions.IgnoreCase); returnMessage = transferinformation.Action.RenameFile(temp[1], temp[2]); } break; case Order.fileOrFolderAction_copy_command: { string[] temp = System.Text.RegularExpressions.Regex.Split(request.param, "-PATH-", System.Text.RegularExpressions.RegexOptions.IgnoreCase); returnMessage = transferinformation.Action.CopyFile(temp[2], temp[1]); } break; case Order.fileOrFolderAction_cut_command: { string[] temp = System.Text.RegularExpressions.Regex.Split(request.param, "-PATH-", System.Text.RegularExpressions.RegexOptions.IgnoreCase); returnMessage = transferinformation.Action.CutFile(temp[2] + @"\", temp[1]); } break; } break; case Order.folderAction_name: switch (request.command) { case Order.nasAction_add: returnMessage = NasFunction.addNasFolder(request.param); break; case Order.nasAction_delete: returnMessage = NasFunction.deleteNasFolder(request.param); break; case Order.folderAction_addtohttp_command: ReturnMessageFormat message = new ReturnMessageFormat(); string method = request.param.Substring(0, 5); //request.param = "VIDIO/AUDIO/IMAGE" + uri string path = request.param.Remove(0, 5); //request.param = uri //FileInfo Info = new FileInfo(path); try { switch (method) { case AreaParty.pages.ListName.VIDIO: MediaConfig.AddMyVideoLibrary(path); //MediaPage.videoList.Add(new MediaPage.ListBoxMediaItem { Name = Info.Name, ImagePath = "/styles/skin/item/item_video.png" }); //MediaPage.dictVideo.Add(Info.Name, path); //MediaPage..Add(new ListBoxMediaItem { Name = Info.Name, ImagePath = "/styles/skin/item/item_video.png" }); break; case AreaParty.pages.ListName.AUDIO: MediaConfig.AddMyAudioLibrary(path); break; case AreaParty.pages.ListName.IMAGE: MediaConfig.AddMyImageLibrary(path); break; } new AreaParty.function.media.MediaFunction().GetThumbnail(path); AreaParty.util.JAVAUtil.AddAlltoHttp(path); message.status = Order.success; message.message = ""; message.data = null; } catch (Exception e) { message.status = Order.failure; message.message = e.Message; message.data = null; } returnMessage = message; break; case Order.folderAction_open_command: { // 此处是打开文件夹代码 if (request.param != Order.folderAction_open_more_param) { NodeFormat root = new NodeFormat(); root.path = request.param; folderContent = transferinformation.Action.OpenFolder(root); } returnMessage = folderContent[0]; folderContent.RemoveAt(0); } break; case Order.fileOrFolderAction_delete_command: { // 此处是删除文件夹的代码 returnMessage = transferinformation.Action.DeleteFolder(request.param); } break; case Order.fileOrFolderAction_rename_command: { // 此处是重命名文件夹的代码 string[] temp = System.Text.RegularExpressions.Regex.Split(request.param, "-PATH-", System.Text.RegularExpressions.RegexOptions.IgnoreCase); returnMessage = transferinformation.Action.RenameFolder(temp[1], temp[2]); } break; case Order.folderAction_add_command: { returnMessage = transferinformation.Action.CreateFolder(request.param); } break; case Order.fileOrFolderAction_copy_command: { string[] temp = System.Text.RegularExpressions.Regex.Split(request.param, "-PATH-", System.Text.RegularExpressions.RegexOptions.IgnoreCase); returnMessage = transferinformation.Action.CopyFolder(temp[1], temp[2]); } break; case Order.fileOrFolderAction_cut_command: { string[] temp = System.Text.RegularExpressions.Regex.Split(request.param, "-PATH-", System.Text.RegularExpressions.RegexOptions.IgnoreCase); returnMessage = transferinformation.Action.CutFolder(temp[2], temp[1]); } break; } break; case Order.diskAction_name: switch (request.command) { case Order.diskAction_get_command: returnMessage = transferinformation.Action.GetDiskList(); break; } break; case Order.appAction_name: switch (request.command) { case Order.appAction_get_command: if (request.param != Order.appAction_get_more_param) { exeContent = transferinformation.Action.GetApplicationList(); } returnMessage = exeContent[0]; exeContent.RemoveAt(0); break; } break; } byte[] messageToSend = Encoding.UTF8.GetBytes(JsonHelper.SerializeObject(returnMessage)); int i = remoteClient.Client.Send(messageToSend); Console.WriteLine("send Message: {0} ", JsonHelper.SerializeObject(returnMessage)); } catch (Exception e) { Console.WriteLine("Action socket 被动关闭" + e.Message); } remoteClient.Close(); } Console.ReadLine(); }