private string GetPathDB(AddConnectionString addConnecString) { string connectionString = addConnecString.connectionString; int start = connectionString.IndexOf(startDataSource); int meta = connectionString.IndexOf(endDataSource); int final = (meta - (start + startDataSource.Length)); start = start + startDataSource.Length; return(connectionString.Substring(start, final)); }
private string GetUser(AddConnectionString addConnecString) { string connectionString = addConnecString.connectionString; if (IsConnectionStringTrusted(connectionString)) { return(""); } int start = connectionString.IndexOf(startUser); int meta = connectionString.IndexOf(startPwd); int final = (meta - (start + startUser.Length)); start = start + startUser.Length; return(connectionString.Substring(start, final)); }
private ObjServiceTrocaXMLConfig GetObj() { ConnectionString conString = new ConnectionString(); AddConnectionString addConnectionString = new AddConnectionString(); addConnectionString.connectionString = GetStringConnection(); conString.add = addConnectionString; SystemServiceModel systemServiceModel = new SystemServiceModel(); ClientServiceModel client = new ClientServiceModel(); EndpontClient endpointClient = new EndpontClient(); endpointClient.address = txtPathWebService.Text; client.endpoint = endpointClient; systemServiceModel.client = client; AppSetting appSettings = new AppSetting(); AddAppSetting saveXML = new AddAppSetting(); AddAppSetting log = new AddAppSetting(); AddAppSetting delay = new AddAppSetting(); saveXML.key = Option.SAVE_XML; saveXML.value = (cbSaveXML.Checked ? "1" : "0"); log.key = Option.PATH_LOG; log.value = txtPathLog.Text; delay.key = Option.DELAY_PROCCESS; delay.value = txtDelayProcess.Text; List <AddAppSetting> listaApp = new List <AddAppSetting>(); listaApp.Add(saveXML); listaApp.Add(log); listaApp.Add(delay); appSettings.add = listaApp; ObjServiceTrocaXMLConfig objSalve = new ObjServiceTrocaXMLConfig(); objSalve.connectionStrings = conString; objSalve.systemServiceModel = systemServiceModel; objSalve.appSettings = appSettings; return(objSalve); }