private void btnUnlock_Click(System.Object sender, System.EventArgs e) { using (com.theprodev.www.Common ws = new com.theprodev.www.Common()) { btnUnlock.Enabled = false; btnCancel.Enabled = false; ws.ActivateProductV2Completed += ActivateProductComplete; ws.ActivateProductV2Async(inEmailAddress.Text.Trim(), inOrderNumber.Text.Trim(), Convert.ToString(My.MyApplication.ProgramID, System.Globalization.CultureInfo.CurrentCulture)); } }
private void ReportError() { using (com.theprodev.www.Common ws = new com.theprodev.www.Common()) { System.Net.IPAddress[] IP = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()); string IPAddresses = ""; //INSTANT C# NOTE: The ending condition of VB 'For' loops is tested only on entry to the loop. Instant C# has created a temporary variable in order to use the initial value of UBound(IP) for every iteration: int tempVar = IP.GetUpperBound(0); for (int i = 0; i <= tempVar; i++) { IPAddresses += IP[i].ToString(); if (!(i == IP.GetUpperBound(0))) { IPAddresses += "<br />"; } } ws.ReportErrorDesktopErrorAsync(DataError.Message + Environment.NewLine + inEmail.Text.Trim(), DataError.StackTrace, DataError.ToString(), My.Computer.Info.OSFullName, IPAddresses, My.MyApplication.Application.AppInfo); } MessageBox.Show("Thank you for reporting this error and helping us make our software better.", "Thank You", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }