|
|
|
@ -0,0 +1,38 @@ |
|
|
|
using Forks.EnterpriseServices.JsonRpc; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Web; |
|
|
|
|
|
|
|
namespace BWP.B3ClientService.Rpcs |
|
|
|
{ |
|
|
|
[Rpc] |
|
|
|
public static class VersionRpc |
|
|
|
{ |
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string CheckVersion(string version) |
|
|
|
{ |
|
|
|
var folder = Path.Combine(HttpRuntime.AppDomainAppPath, "ClientVersion"); |
|
|
|
var versionPath = Path.Combine(folder, "Version.txt"); |
|
|
|
if (File.Exists(versionPath)) |
|
|
|
{ |
|
|
|
if (File.ReadAllText(versionPath) == version) |
|
|
|
return null; |
|
|
|
else |
|
|
|
return GetAllFiles(folder); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
static string GetAllFiles(string path) |
|
|
|
{ |
|
|
|
var list = new List<string>(); |
|
|
|
var folder = new DirectoryInfo(path); |
|
|
|
foreach (var file in folder.GetFiles()) |
|
|
|
list.Add(file.Name); |
|
|
|
return string.Join(",", list); |
|
|
|
} |
|
|
|
} |
|
|
|
} |