private short f_GetWCInformation() { try { wcServerAPI.TMakewild myMW = new wcServerAPI.TMakewild(); if (wcServerAPI.GetMakewild(ref myMW)) { txtSystemName.Text = modBSMiniRPT.BBSName.Trim(); txtSysop.Text = modBSMiniRPT.BBSSysopName.Trim(); txtFirstCall.Text = myMW.FirstCall.Trim(); txtRegNum.Text = myMW.RegString.Trim(); txtServerBuild.Text = wcServerAPI.GetWildcatBuild().ToString().Trim(); txtTotalConfs.Text = wcServerAPI.GetConferenceCount().ToString().Trim(); txtActiveConfs.Text = wcServerAPI.GetEffectiveConferenceCount(0, 0).ToString().Trim(); txtConfGroups.Text = wcServerAPI.GetConferenceGroupCount().ToString().Trim(); txtTotalFileAreas.Text = wcServerAPI.GetFileAreaCount().ToString().Trim(); txtActiveFileAreas.Text = wcServerAPI.GetEffectiveFileAreaCount(0, 0).ToString().Trim(); txtFileGroups.Text = wcServerAPI.GetFileGroupCount().ToString().Trim(); txtTotalSecurity.Text = wcServerAPI.GetSecurityProfileCount().ToString().Trim(); txtDoors.Text = wcServerAPI.GetDoorCount().ToString().Trim(); txtLanguages.Text = wcServerAPI.GetLanguageCount().ToString().Trim(); txtTotalMsgs.Text = wcServerAPI.GetTotalMessages().ToString().Trim(); txtTotalUsersOn.Text = wcServerAPI.GetUsersOnline().ToString().Trim(); txtTotalFiles.Text = wcServerAPI.GetTotalFiles().ToString().Trim(); txtTotalUsers.Text = wcServerAPI.GetTotalUsers().ToString().Trim(); txtTotalCalls.Text = wcServerAPI.GetTotalCalls(0).ToString().Trim(); txtMaxUserCount.Text = wcServerAPI.GetMaximumUserCount().ToString().Trim(); } else { MessageBox.Show("Error pulling the MakeWild information", "WINServer DLL Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("Unexpected Error occurred" + Environment.NewLine + "Error: " + ex.ToString() + Environment.NewLine + "Message: " + ex.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return 0; }
public static bool ConnectToWINS(object objStatus) { bool tempConnectToWINS = false; wcServerAPI.TMakewild myMW = new wcServerAPI.TMakewild(); int RetVal = 0; tempConnectToWINS = true; if (objStatus == null) { } else { ((System.Windows.Forms.Label)objStatus).Text = "Finding WINS Server..."; ((System.Windows.Forms.Label)objStatus).Refresh(); } if (wcServerAPI.WildcatServerConnect(0)) { ConnectedServer = wcSDK.wcServerAPI.GetConnectedServer(); if (objStatus == null) { } else { ((System.Windows.Forms.Label)objStatus).Text = "Creating Context..."; ((System.Windows.Forms.Label)objStatus).Refresh(); } if (wcServerAPI.WildcatServerCreateContext()) { if (objStatus == null) { } else { ((System.Windows.Forms.Label)objStatus).Text = "Logging in as SYSTEM..."; ((System.Windows.Forms.Label)objStatus).Refresh(); } if (wcServerAPI.LoginSystem()) { } else { wcServerAPI.WildcatServerDeleteContext(); MessageBox.Show("Unable to login as system" + Environment.NewLine + "Error: " + WildcatError(Marshal.GetLastWin32Error()), "Can't login", MessageBoxButtons.OK, MessageBoxIcon.Error); tempConnectToWINS = false; } if (objStatus == null) { } else { ((System.Windows.Forms.Label)objStatus).Text = "Please Wait (continuing)..."; ((System.Windows.Forms.Label)objStatus).Refresh(); } } else { MessageBox.Show("Unable to create context" + Environment.NewLine + "Error: " + WildcatError(Marshal.GetLastWin32Error()), "Unable to create context", MessageBoxButtons.OK, MessageBoxIcon.Error); tempConnectToWINS = false; } } else { MessageBox.Show("Unable to connect to server" + Environment.NewLine + "Error: " + WildcatError(Marshal.GetLastWin32Error()), "Unable to connect", MessageBoxButtons.OK, MessageBoxIcon.Error); tempConnectToWINS = false; } if (System.Convert.ToSingle(wcServerAPI.GetWildcatVersion().ToString().Trim() + "." + wcServerAPI.GetWildcatBuild().ToString().Trim()) > 1.44) { isNewWINS = true; } wcServerAPI.GetMakewild(ref myMW); BBSName = myMW.BBSName.Trim(); BBSReg = myMW.RegString.Trim(); BBSSysopName = myMW.SysopName.Trim(); return tempConnectToWINS; }