You forgot one important piece of your url....
http://
string content = new System.Net.WebCient().DownloadString(URL);
try
{
string content = new System.Net.WebCient().DownloadString(URL);
}
catch
{
Player.SendMessage(p, "An error occurred retrieving server news.");
}
Leeizazombie wrote:Hmm perfect! Thanks guys!
Leeizazombie wrote:Oh one more thing, is there a possible way to use something like File.ReadAllLines in the webclient version?
Hello welcome to my server$Please read the rules$You can type /rules$Also check out the /help menu
public override void Use(Player p, string message)
{
try
{
string content = new System.Net.WebClient().DownloadString("http://conor.com/news.txt");
foreach(string line in content.Split('$'))
{
Player.SendMessage(p, line);
}
}
catch
{
Player.SendMessage(p, "Error getting news.");
}
}
Users browsing this forum: No registered users and 16 guests