public static List <string> GetDeletedProjectList() { List <string> projList = new List <string>(); string[] projects = Directory.GetFiles(ProjectUtil.szBasePath, "*.deleted"); foreach (var project in projects) { string szProjectName = project.Split(Path.DirectorySeparatorChar).LastOrDefault(); if (ProjectUtil.IsValidName(szProjectName)) { projList.Add(szProjectName); } } return(projList); }
public static async Task <List <string> > GetRemoteProjectListAsync() { string szJson = ""; List <string> projList = new List <string>(); szJson = await httpClient.GetStringAsync(szServer); // [{"szProjectName":"Test1","lSize":11496036},{"szProjectName":"Test2","lSize":11496036}] List <JsonProject> remoteProjects = JsonConvert.DeserializeObject <List <JsonProject> >(szJson); foreach (var project in remoteProjects) { if (ProjectUtil.IsValidName(project.szProjectName)) { projList.Add(project.szProjectName); } } return(projList); }