BaseSvc.cs 1.6 KB
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;
    }

}