/// <summary> /// 从服务端下载应用程序文件列表。 /// </summary> /// <param name="entName">企业名称。</param> /// <param name="version">应用程序版本。</param> public static List <AppFileInfo> GetAllFiles(string entName, string version) { string result = client.ufileDetailGet(entName, version); VerifyReturnCode(result); DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List <AppFileInfo>)); using (MemoryStream stream = new MemoryStream(Encoding.Unicode.GetBytes(result))) { object o = serializer.ReadObject(stream) as List <AppFileInfo>; return(o as List <AppFileInfo>); } }
/// <summary> /// 从服务端下载应用程序文件列表。 /// </summary> /// <param name="entName">企业名称。</param> /// <param name="version">应用程序版本。</param> public static List <AppFileInfo> GetAllFiles(string entName, string version) { string result = client.ufileDetailGet(entName, version); ReturnCode code = GetReturn(result); VerifyReturnCode(code.code); DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List <AppFileInfo>)); List <AppFileInfo> list = null; using (MemoryStream stream = new MemoryStream(Encoding.Unicode.GetBytes(result))) { list = serializer.ReadObject(stream) as List <AppFileInfo>; } foreach (var item in list) { if (item.fileName.EndsWith(".remove")) { item.fileName = item.fileName.Substring(0, item.fileName.Length - 7); } } return(list); }