public frmParser() { InitializeComponent(); clsWS_Pilot = new imssp3.IMSWS(); clsWS_Phase2 = new imssp.IMSWS(); }
private void cbbLocation_SelectedIndexChanged(object sender, System.EventArgs e) { strLocation = cbbLocation.Items[cbbLocation.SelectedIndex].ToString().Trim(); switch (strLocation) { case "Client": { // Get the Client's MDSE_CONN_STRING value from startup dir's .config file this.strConn = this.GetConnectionString(Application.StartupPath + "\\IMS.exe.config", "MSDE_CONN_STRING"); //MessageBox.Show(this.strConn); } break; case "Server": { // Get the Server's .config ConnectionString value from file specified in modal form Form f = new frmServerWebConfigLoc(); f.Text = strLocation + " Web.config"; if (f.ShowDialog(this) == DialogResult.Cancel) { cbbLocation.SelectedIndex = 0; return; } this.strConnPhase2Server = this.GetConnectionString(((frmServerWebConfigLoc)f).txtConfigLoc.Text, "ConnectionStringPhase2"); this.strConn = this.GetConnectionString(((frmServerWebConfigLoc)f).txtConfigLoc.Text, "ConnectionString"); this.strUsername = ((frmServerWebConfigLoc)f).txtUsername.Text.Trim(); this.strPassword = ((frmServerWebConfigLoc)f).txtUsername.Text.Trim(); this.strDomain = ((frmServerWebConfigLoc)f).txtDomain.Text.Trim(); //MessageBox.Show(this.strConn + "\n" + this.strConnPhase2Server + "\n" + this.strUsername + "\n" + this.strDomain); // Create and connect to Pilot WebService clsWS_Pilot = new imssp3.IMSWS(); clsWS_Pilot.Credentials = System.Net.CredentialCache.DefaultCredentials; clsWS_Pilot.ConnectionGroupName = "Group" + System.Security.Principal.WindowsIdentity.GetCurrent().Name; clsWS_Pilot.UnsafeAuthenticatedConnectionSharing = true; clsWS_Phase2 = new imssp.IMSWS(); clsWS_Phase2.Credentials = System.Net.CredentialCache.DefaultCredentials; clsWS_Phase2.ConnectionGroupName = "Group" + System.Security.Principal.WindowsIdentity.GetCurrent().Name; clsWS_Phase2.UnsafeAuthenticatedConnectionSharing = true; /* * This doesn't work the same as CredentialCache.DefaultCredentials for some reason... * * System.Net.NetworkCredential auth = * new System.Net.NetworkCredential( * this.strUsername * ,this.strPassword * ,this.strDomain * ); * * clsWS_Pilot.Credentials = auth; */ } break; } this.Bind5701NTLoginIDs(); this.Bind5701List(); }
private void cbbLocation_SelectedIndexChanged(object sender, System.EventArgs e) { strLocation = cbbLocation.Items[cbbLocation.SelectedIndex].ToString().Trim(); switch (strLocation) { case "Client" : { // Get the Client's MDSE_CONN_STRING value from startup dir's .config file this.strConn = this.GetConnectionString(Application.StartupPath + "\\IMS.exe.config", "MSDE_CONN_STRING"); //MessageBox.Show(this.strConn); } break; case "Server" : { // Get the Server's .config ConnectionString value from file specified in modal form Form f = new frmServerWebConfigLoc(); f.Text = strLocation + " Web.config"; if (f.ShowDialog(this) == DialogResult.Cancel) { cbbLocation.SelectedIndex = 0; return; } this.strConnPhase2Server = this.GetConnectionString(((frmServerWebConfigLoc)f).txtConfigLoc.Text, "ConnectionStringPhase2"); this.strConn = this.GetConnectionString(((frmServerWebConfigLoc)f).txtConfigLoc.Text, "ConnectionString"); this.strUsername = ((frmServerWebConfigLoc)f).txtUsername.Text.Trim(); this.strPassword = ((frmServerWebConfigLoc)f).txtUsername.Text.Trim(); this.strDomain = ((frmServerWebConfigLoc)f).txtDomain.Text.Trim(); //MessageBox.Show(this.strConn + "\n" + this.strConnPhase2Server + "\n" + this.strUsername + "\n" + this.strDomain); // Create and connect to Pilot WebService clsWS_Pilot = new imssp3.IMSWS(); clsWS_Pilot.Credentials = System.Net.CredentialCache.DefaultCredentials; clsWS_Pilot.ConnectionGroupName = "Group" + System.Security.Principal.WindowsIdentity.GetCurrent().Name; clsWS_Pilot.UnsafeAuthenticatedConnectionSharing = true; clsWS_Phase2 = new imssp.IMSWS(); clsWS_Phase2.Credentials = System.Net.CredentialCache.DefaultCredentials; clsWS_Phase2.ConnectionGroupName = "Group" + System.Security.Principal.WindowsIdentity.GetCurrent().Name; clsWS_Phase2.UnsafeAuthenticatedConnectionSharing = true; /* This doesn't work the same as CredentialCache.DefaultCredentials for some reason... System.Net.NetworkCredential auth = new System.Net.NetworkCredential( this.strUsername ,this.strPassword ,this.strDomain ); clsWS_Pilot.Credentials = auth; */ } break; } this.Bind5701NTLoginIDs(); this.Bind5701List(); }