Browse Source

修改。

master
yibo 8 years ago
parent
commit
b2b15f2228
2 changed files with 40 additions and 0 deletions
  1. +2
    -0
      B3ClientService/B3ClientService.csproj
  2. +38
    -0
      B3ClientService/Rpcs/VersionRpc.cs

+ 2
- 0
B3ClientService/B3ClientService.csproj View File

@ -49,6 +49,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@ -119,6 +120,7 @@
<Compile Include="Rpcs\BillRpc\GradeAndWeightRpc.cs" />
<Compile Include="Rpcs\BillRpc\WeightBillRpc.cs" />
<Compile Include="Rpcs\UserInfoRpc.cs" />
<Compile Include="Rpcs\VersionRpc.cs" />
<Compile Include="Tasks\SyncInfoFromServer.cs" />
<Compile Include="Tasks\UpdateLoad\UploadOrderDetail.cs" />
<Compile Include="Tasks\UpdateLoad\UploadSecondOrder.cs" />


+ 38
- 0
B3ClientService/Rpcs/VersionRpc.cs View File

@ -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);
}
}
}

Loading…
Cancel
Save