fix a few unhandled errors
This commit is contained in:
parent
bc90f68f66
commit
2b9430101e
3 changed files with 90 additions and 66 deletions
|
@ -335,10 +335,17 @@ public class ControlApp : Form
|
||||||
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();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(user) || string.IsNullOrEmpty(pwd))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
string vrs = "012";
|
string vrs = "012";
|
||||||
string result = utils.getcmd(user, pwd, vrs, "Outstanding");
|
string result = utils.getcmd(user, pwd, vrs, "Outstanding");
|
||||||
string[] ret = utils.seperate_string(result);
|
string[] ret = utils.seperate_string(result);
|
||||||
|
|
|
@ -35,17 +35,27 @@ internal class Utils
|
||||||
|
|
||||||
public void writetolog(string shortvr, string longvr)
|
public void writetolog(string shortvr, string longvr)
|
||||||
{
|
{
|
||||||
|
shortvr = CleanStringForLog(shortvr);
|
||||||
|
longvr = CleanStringForLog(longvr);
|
||||||
|
|
||||||
if (ConfigurationManager.AppSettings["Logging"] == "On")
|
if (ConfigurationManager.AppSettings["Logging"] == "On")
|
||||||
{
|
{
|
||||||
if (ConfigurationManager.AppSettings["Logging"] == "On")
|
File.AppendAllText("log.txt", shortvr+ "\n");
|
||||||
{
|
|
||||||
File.AppendAllText("log.txt", shortvr);
|
|
||||||
}
|
}
|
||||||
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,6 +596,7 @@ 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();
|
||||||
|
writetolog("Banned content found in message", what);
|
||||||
break;
|
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