📄 configinformation.cs
字号:
using System;
using Pierce.AttributeClass;
namespace Cngp
{
/// <summary>
/// ConfigInformation:配置文件参数,全部使用静态值
/// </summary>
[LastModified("2006-01-05","对应配置文件的参数")]
[LastModified("2007-02-01","增加状态报告参数")]
internal class ConfigInformation
{
/// <summary>
/// Gate user name
/// </summary>
private static string gateUserName;
/// <summary>
/// Gate password
/// </summary>
private static string gateUserPassword;
/// <summary>
/// 企业代码
/// </summary>
private static string corpId;
/// <summary>
/// 网关IP
/// </summary>
private static string gateIp;
/// <summary>
/// 网关端口 Port
/// </summary>
private static int gatePort;
/// <summary>
/// 启动的连接数量
/// </summary>
private static string multiApp;
/// <summary>
/// 是否允许连接数据库
/// </summary>
private static string connectDb;
/// <summary>
/// 启动的实例数
/// </summary>
private static int instanceCount;
/// <summary>
/// 数据库用户名
/// </summary>
private static string oraUser;
/// <summary>
/// 数据库密码
/// </summary>
private static string oraPassword;
/// <summary>
/// 数据库服务名
/// </summary>
private static string oraService;
/// <summary>
/// 发送速度
/// </summary>
private static string sendspeed;
/// <summary>
/// socket receivetimeout
/// </summary>
private static int receivetimeout;
/// <summary>
/// socket sendtimeout
/// </summary>
private static int sendtimeout;
/// <summary>
/// socket lingertime
/// </summary>
private static int lingertime;
/// <summary>
/// 是否需要状态报告
/// </summary>
private static int needreport;
/// <summary>
/// 不允许实例化
/// </summary>
private ConfigInformation()
{
}
/// <summary>
/// 静态属性,读写,是否需要状态报告
/// </summary>
[LastModified("2007-02-01","增加是否需要状态报告")]
public static int Needreport
{
get
{
return needreport;
}
set
{
needreport=value;
}
}
/// <summary>
/// 静态属性,读写,网关用户名
/// </summary>
public static string GateUserName
{
get
{
if(gateUserName==null)
{
throw new Exception("gateUserName is null");
}
return gateUserName;
}
set{gateUserName=value;}
}
/// <summary>
/// 静态属性,读写,网关用户密码
/// </summary>
public static string GateUserPassword
{
get
{
if(gateUserPassword==null)
{
throw new Exception("gateUserPassword is null");
}
return gateUserPassword;
}
set{gateUserPassword=value;}
}
/// <summary>
/// 静态属性,读写,企业代码
/// </summary>
public static string CorpId
{
get
{
if(corpId==null)
{
throw new Exception("corpId is null");
}
return corpId;
}
set{corpId=value;}
}
/// <summary>
/// 静态属性,读写,网关IP地址
/// </summary>
public static string GateIp
{
get
{
if(gateIp==null)
{
throw new Exception("gateIp is null");
}
return gateIp;
}
set
{
gateIp=value;
}
}
/// <summary>
/// 静态属性,读写,网关端口
/// </summary>
public static int GatePort
{
get
{
if(gatePort==0)
{
throw new Exception("gatePort is null");
}
return gatePort;
}
set
{
gatePort=value;
}
}
/// <summary>
/// 静态属性,读写,启动的连接数
/// </summary>
public static string MultiApp
{
get
{
if(multiApp==null)
{
throw new Exception("multiApp is null");
}
return multiApp;
}
set{multiApp=value;}
}
/// <summary>
/// 静态属性,读写,是否允许连接数据库,0:不连接,1:连接
/// </summary>
public static string ConnectDb
{
get
{
if(connectDb==null)
{
throw new Exception("connectDb is null");
}
return connectDb;
}
set
{
connectDb=value;
}
}
/// <summary>
/// 静态属性,读写,数据库用户
/// </summary>
public static string OraUser
{
get
{
if(oraUser==null)
{
throw new Exception("oraUser is null");
}
return oraUser;
}
set
{
oraUser=value;
}
}
/// <summary>
/// 静态属性,读写,数据库密码
/// </summary>
public static string OraPassword
{
get
{
if(oraPassword==null)
{
throw new Exception("oraPassword is null");
}
return oraPassword;
}
set
{
oraPassword=value;
}
}
/// <summary>
/// 静态属性,读写,数据库服务名
/// </summary>
public static string OraService
{
get
{
if(oraService==null)
{
throw new Exception("oraService is null");
}
return oraService;
}
set
{
oraService=value;
}
}
/// <summary>
/// 静态属性,读写,启动的连接数
/// </summary>
public static int InstanceCount
{
get
{
if(instanceCount==0)
{
throw new Exception("instanceCount is 0");
}
return instanceCount;
}
set
{
instanceCount=Convert.ToInt32(value);
}
}
/// <summary>
/// 静态属性,读写,发送速度,1000/sendspeed=条/秒
/// </summary>
public static string Sendspeed
{
get
{
if(sendspeed==null)
{
throw new Exception("sendspeed is null");
}
return sendspeed;
}
set{sendspeed=value;}
}
/// <summary>
/// 静态属性,读写,Socket 的Sendtimeout
/// </summary>
public static int SendTimeout
{
get
{
if(sendtimeout==0)
{
throw new Exception("sendtimeout is null");
}
return sendtimeout;
}
set
{
sendtimeout=value;
}
}
/// <summary>
/// 静态属性,读写,Socket 的ReceiveTimeOut
/// </summary>
public static int ReceiveTimeout
{
get
{
if(receivetimeout==0)
{
throw new Exception("receivetimeout is null");
}
return receivetimeout;
}
set
{
receivetimeout=value;
}
}
/// <summary>
/// 静态属性,读写,Socket Lingertime
/// </summary>
public static int Lingertime
{
get
{
if(lingertime==0)
{
throw new Exception("lingertime is null");
}
return lingertime;
}
set
{
lingertime=value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -