Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Commit

Permalink
注册表相关修复
Browse files Browse the repository at this point in the history
  • Loading branch information
Left024 committed Dec 14, 2020
1 parent f886ffa commit ece39c5
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 57 deletions.
Binary file modified .vs/NTU/v16/.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions NTU/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 68 additions & 52 deletions NTU/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,21 @@ private void startlogin_Click(object sender, EventArgs e)
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser;
Microsoft.Win32.RegistryKey run = key.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
run.SetValue("NTU", System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);


}
else
{
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser;
Microsoft.Win32.RegistryKey run = key.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
run.SetValue("NTU", 123);
RegistryKey key = Registry.CurrentUser;

RegistryKey software = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);

try
{
software.DeleteValue("NTU");
}
catch
{ }
}

}
Expand Down Expand Up @@ -555,75 +563,81 @@ public static string RunApp(string filename, string arguments, bool recordLog)

public void denglu()
{
g_wifi = new Wifi();
var t = g_wifi.GetAccessPoints();
string name = Dns.GetHostName();
CommonData.ip = GetLocalIP();
if (xyw.Checked == true)
{
CommonData.yys = "";
}
else if (cmcc.Checked == true)
{
CommonData.yys = "%40cmcc";
}
else if (unicom.Checked == true)
{
CommonData.yys = "%40unicom";
}
else if (telecom.Checked == true)
{
CommonData.yys = "%40telecom";
}
CommonData.username = UsernameTextBox.Text;
CommonData.password = PasswordTextBox.Text;
CommonData.url = "http://210.29.79.141:801/eportal/?c=Portal&a=login&callback=dr1003&login_method=1&user_account=%2C0%2C" + CommonData.username + CommonData.yys + "&user_password=" + CommonData.password + "&wlan_user_ip=" + CommonData.ip + "&wlan_user_ipv6=&wlan_user_mac=000000000000&wlan_ac_ip=&wlan_ac_name=ME60&jsVersion=3.3.2&v=6376";
foreach (var item in t)
try
{
if (item.Name == "NTU")
g_wifi = new Wifi();
var t = g_wifi.GetAccessPoints();
string name = Dns.GetHostName();
CommonData.ip = GetLocalIP();
if (xyw.Checked == true)
{
AuthRequest ar = new AuthRequest(item);
ar.Password = "";
if (item.IsConnected == false)
CommonData.yys = "";
}
else if (cmcc.Checked == true)
{
CommonData.yys = "%40cmcc";
}
else if (unicom.Checked == true)
{
CommonData.yys = "%40unicom";
}
else if (telecom.Checked == true)
{
CommonData.yys = "%40telecom";
}
CommonData.username = UsernameTextBox.Text;
CommonData.password = PasswordTextBox.Text;
CommonData.url = "http://210.29.79.141:801/eportal/?c=Portal&a=login&callback=dr1003&login_method=1&user_account=%2C0%2C" + CommonData.username + CommonData.yys + "&user_password=" + CommonData.password + "&wlan_user_ip=" + CommonData.ip + "&wlan_user_ipv6=&wlan_user_mac=000000000000&wlan_ac_ip=&wlan_ac_name=ME60&jsVersion=3.3.2&v=6376";
foreach (var item in t)
{
if (item.Name == "NTU")
{
item.Connect(ar);
for (; ; )
AuthRequest ar = new AuthRequest(item);
ar.Password = "";
if (item.IsConnected == false)
{
if (item.IsConnected == true)
item.Connect(ar);
for (; ; )
{
for (; ; )
if (item.IsConnected == true)
{
//string baidu = GetHtmlByUrl("http://baidu.com/1.txt");
if (CommonData.netstatus == "-1")
for (; ; )
{
string url = string.Format(CommonData.url);
using (var wc = new WebClient())
//string baidu = GetHtmlByUrl("http://baidu.com/1.txt");
if (CommonData.netstatus == "-1")
{
Encoding enc = Encoding.GetEncoding("UTF-8");
Byte[] pageData = wc.DownloadData(url);
string re = enc.GetString(pageData);
string url = string.Format(CommonData.url);
using (var wc = new WebClient())
{
Encoding enc = Encoding.GetEncoding("UTF-8");
Byte[] pageData = wc.DownloadData(url);
string re = enc.GetString(pageData);
}
break;
}
break;
}
break;
}
break;
}
}
}
else
{
string url = string.Format(CommonData.url);
using (var wc = new WebClient())
else
{
Encoding enc = Encoding.GetEncoding("UTF-8");
Byte[] pageData = wc.DownloadData(url);
string re = enc.GetString(pageData);
string url = string.Format(CommonData.url);
using (var wc = new WebClient())
{
Encoding enc = Encoding.GetEncoding("UTF-8");
Byte[] pageData = wc.DownloadData(url);
string re = enc.GetString(pageData);
}
}
}

}
}
}
catch
{
}
}

private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
Expand Down Expand Up @@ -673,5 +687,7 @@ private void toolStripMenuItem1_Click(object sender, EventArgs e)
this.Dispose(); //释放资源
Application.Exit(); //关闭应用程序窗体
}


}
}
2 changes: 1 addition & 1 deletion NTU/obj/Debug/NTU.application
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>DxvYw2GscL1689fa6a8MfmDx4vE8wXxNmQJxEPnvGMQ=</dsig:DigestValue>
<dsig:DigestValue>IBMHWsE+3IFirPB6SCy2IbuRz4tkFvj6BAomYaHqJY8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified NTU/obj/Debug/NTU.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified NTU/obj/Debug/NTU.csprojAssemblyReference.cache
Binary file not shown.
Binary file modified NTU/obj/Debug/NTU.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions NTU/obj/Debug/NTU.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="NTU.exe" size="28632">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="NTU.exe" size="29144">
<assemblyIdentity name="NTU" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>0URCNbfQ4UKPiKpND/BBeWICWd/r5LFq1QscsyqX9dg=</dsig:DigestValue>
<dsig:DigestValue>wYYiZfaphS4dhsyUizjPxB2vGZFI9XswD6LG5tpzIM0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified NTU/obj/Debug/NTU.pdb
Binary file not shown.

0 comments on commit ece39c5

Please sign in to comment.