/// <summary> /// 有参构造函数 /// </summary> /// <param name="dataBasePath">Access数据库路径</param> public MDBservice(String dataBasePath) { serverFileFolder = "c:\\destFiles\\"; this.DataBasePath = dataBasePath; //this.StrConnection = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + this.DataBasePath; //初始化表结构信息 this.setColumnList(); //获取学位分类表 sqlcmd = new OleDbCommand(); sqlcmd.Connection = this.ObjConnection; operationLogDAO = new OperationLog_DAO(); }
/// <summary> /// 无参构造函数 /// </summary> public MDBservice() { serverFileFolder = "c:\\destFiles\\"; try { string configFileName = AppDomain.CurrentDomain.BaseDirectory + "\\server.config"; StreamReader sr = new StreamReader(configFileName); serverAddress = sr.ReadLine().ToString(); int index = serverAddress.IndexOf('/'); string ipAddress; if (index >= 0) ipAddress = serverAddress.Substring(0, index); else ipAddress = serverAddress; String[] nums = ipAddress.Split(".".ToCharArray()); System.Exception e = new Exception("IP地址错误"); if (nums.Count() != 4) { throw (e); } foreach (String str in nums) { int num = int.Parse(str); if (num < 0 || num > 255) { throw (e); } } } catch { } //FTPtransfer = new FtpUpDown(serverAddress, "user", "***"); //获取学位分类表 sqlcmd = new OleDbCommand(); sqlcmd.Connection = this.ObjConnection; operationLogDAO = new OperationLog_DAO(); }