fix a few unhandled errors
This commit is contained in:
parent
bc90f68f66
commit
2b9430101e
3 changed files with 90 additions and 66 deletions
|
@ -330,56 +330,63 @@ public class ControlApp : Form
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void chk_next()
|
public void chk_next()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.Cursor.Show();
|
System.Windows.Forms.Cursor.Show();
|
||||||
Cursor cursor = System.Windows.Forms.Cursor.Current;
|
Cursor cursor = System.Windows.Forms.Cursor.Current;
|
||||||
System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
|
System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
|
||||||
try
|
|
||||||
{
|
string user = ConfigurationManager.AppSettings["UserName"].ToString();
|
||||||
string user = ConfigurationManager.AppSettings["UserName"].ToString();
|
string pwd = ConfigurationManager.AppSettings["Password"].ToString();
|
||||||
string pwd = ConfigurationManager.AppSettings["Password"].ToString();
|
|
||||||
string vrs = "012";
|
if (string.IsNullOrEmpty(user) || string.IsNullOrEmpty(pwd))
|
||||||
string result = utils.getcmd(user, pwd, vrs, "Outstanding");
|
{
|
||||||
string[] ret = utils.seperate_string(result);
|
return;
|
||||||
Nocomds.Text = ret[0];
|
}
|
||||||
whonxtlbl.Text = ret[1];
|
|
||||||
if (ret[2] == "0")
|
try
|
||||||
{
|
{
|
||||||
varified = false;
|
string vrs = "012";
|
||||||
}
|
string result = utils.getcmd(user, pwd, vrs, "Outstanding");
|
||||||
else
|
string[] ret = utils.seperate_string(result);
|
||||||
{
|
Nocomds.Text = ret[0];
|
||||||
varified = true;
|
whonxtlbl.Text = ret[1];
|
||||||
}
|
if (ret[2] == "0")
|
||||||
ScoreTxt.Text = ret[3];
|
{
|
||||||
if (Nocomds.Text != "0")
|
varified = false;
|
||||||
{
|
}
|
||||||
try
|
else
|
||||||
{
|
{
|
||||||
if (ConfigurationManager.AppSettings["OutstandRemind"] == null || !Convert.ToBoolean(ConfigurationManager.AppSettings["OutstandRemind"].ToString()))
|
varified = true;
|
||||||
{
|
}
|
||||||
if (Nocomds.Text == "1")
|
ScoreTxt.Text = ret[3];
|
||||||
{
|
if (Nocomds.Text != "0")
|
||||||
new CustomMessage("You have " + Nocomds.Text + " outstanding command.", "", 0, tts: true).ShowDialog();
|
{
|
||||||
}
|
try
|
||||||
else if (Convert.ToInt16(Nocomds.Text) > 1)
|
{
|
||||||
{
|
if (ConfigurationManager.AppSettings["OutstandRemind"] == null || !Convert.ToBoolean(ConfigurationManager.AppSettings["OutstandRemind"].ToString()))
|
||||||
new CustomMessage("You have " + Nocomds.Text + " outstanding commands.", "", 0, tts: true).ShowDialog();
|
{
|
||||||
}
|
if (Nocomds.Text == "1")
|
||||||
}
|
{
|
||||||
}
|
new CustomMessage("You have " + Nocomds.Text + " outstanding command.", "", 0, tts: true).ShowDialog();
|
||||||
catch
|
}
|
||||||
{
|
else if (Convert.ToInt16(Nocomds.Text) > 1)
|
||||||
}
|
{
|
||||||
}
|
new CustomMessage("You have " + Nocomds.Text + " outstanding commands.", "", 0, tts: true).ShowDialog();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
}
|
||||||
utils.writetolog("Error checking for count", "Error checking for count :" + ex.Message);
|
catch
|
||||||
}
|
{
|
||||||
System.Windows.Forms.Cursor.Current = cursor;
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
utils.writetolog("Error checking for count", "Error checking for count :" + ex.Message);
|
||||||
|
}
|
||||||
|
System.Windows.Forms.Cursor.Current = cursor;
|
||||||
|
}
|
||||||
|
|
||||||
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,20 +33,30 @@ internal class Utils
|
||||||
|
|
||||||
public string[] blist = new string[1] { "" };
|
public string[] blist = new string[1] { "" };
|
||||||
|
|
||||||
public void writetolog(string shortvr, string longvr)
|
public void writetolog(string shortvr, string longvr)
|
||||||
{
|
{
|
||||||
if (ConfigurationManager.AppSettings["Logging"] == "On")
|
shortvr = CleanStringForLog(shortvr);
|
||||||
{
|
longvr = CleanStringForLog(longvr);
|
||||||
if (ConfigurationManager.AppSettings["Logging"] == "On")
|
|
||||||
{
|
if (ConfigurationManager.AppSettings["Logging"] == "On")
|
||||||
File.AppendAllText("log.txt", shortvr);
|
{
|
||||||
}
|
File.AppendAllText("log.txt", shortvr+ "\n");
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
File.AppendAllText("log.txt", longvr);
|
{
|
||||||
}
|
File.AppendAllText("log.txt", longvr+ "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string CleanStringForLog(string stringinput)
|
||||||
|
{
|
||||||
|
stringinput = Decrypt(stringinput);
|
||||||
|
if (stringinput.EndsWith("&&&"))
|
||||||
|
{
|
||||||
|
stringinput = stringinput.Substring(0, stringinput.Length - 3);
|
||||||
|
}
|
||||||
|
return stringinput;
|
||||||
|
}
|
||||||
|
|
||||||
public string[] GetLatestItem()
|
public string[] GetLatestItem()
|
||||||
{
|
{
|
||||||
|
@ -586,7 +596,8 @@ internal class Utils
|
||||||
if (inbanned)
|
if (inbanned)
|
||||||
{
|
{
|
||||||
new CustomMessage("Message contains potential bad stuff closing", "", 4, tts: false).ShowDialog();
|
new CustomMessage("Message contains potential bad stuff closing", "", 4, tts: false).ShowDialog();
|
||||||
break;
|
writetolog("Banned content found in message", what);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (what.Substring(0, 3) == "FTP")
|
if (what.Substring(0, 3) == "FTP")
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<appSettings file="">
|
<appSettings file="">
|
||||||
<clear />
|
<clear />
|
||||||
|
@ -46,5 +46,11 @@
|
||||||
<add key="DTTS" value="False" />
|
<add key="DTTS" value="False" />
|
||||||
<add key="DDisM" value="False" />
|
<add key="DDisM" value="False" />
|
||||||
<add key="DPopSet" value="Short" />
|
<add key="DPopSet" value="Short" />
|
||||||
|
<add key="LocalDrive" value="Downloads" />
|
||||||
|
<add key="AutoRun" value="False" />
|
||||||
|
<add key="UserName" value="" />
|
||||||
|
<add key="Password" value="" />
|
||||||
|
<add key="RunAll" value="False" />
|
||||||
|
<add key="Delay" value="30" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
</configuration>
|
</configuration>
|
Loading…
Reference in a new issue