BaseSvc.cs
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Data;
using System.Web;
using System.Reflection;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.EnterpriseServices;
using Comm;
/// <summary>
/// BaseSvc 的摘要说明
/// </summary>
[Transaction(TransactionOption.Required)]
[WebServiceAttribute(Namespace = strNameSpace)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class BaseSvc : System.Web.Services.WebService
{
public const string strNameSpace = "http://www.Shixintech.com/MyCMMI/";
public BaseSvc()
{
//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[WebMethod(Description = "获得当前版本信息", EnableSession = true, TransactionOption = TransactionOption.RequiresNew)]
public bool TestServiceUrl()
{
bool strVer = false;
try
{
strVer = true;
}
catch //(Exception e)
{
//throw e;
}
return strVer;
}
[WebMethod(Description = "获得当前版本信息", EnableSession = true, TransactionOption = TransactionOption.RequiresNew)]
public string GetServiceVersion()
{
string strVer = "";
try
{
string str = Server.MapPath("") + @"\Comm.dll";
Assembly Asm = Assembly.LoadFrom(Server.MapPath("") + @"\bin\Comm.dll");
AssemblyName AsmName = Asm.GetName();
strVer = AsmName.Version.ToString();
}
catch (Exception e)
{
throw e;
}
//Application
return strVer;
}
}