I’m a PHP developer, attempting to teach myself C#. I’ve got the following test code:
//longbow.cs
using System;
using System.Net;
public class LongbowCore {
//version of the software
public static string version = "0.1";
//Text displayed during startup
public static string init_text = "Longbow v"+LongbowCore.version;
//API URL base for sessions
public static string api_url = "http://dev.phyre.im";
public static void Main(string[] args){
Console.WriteLine(LongbowCore.init_text);
var fetch = new WebClient();
var data = fetch.DownloadString(api_url);
Console.WriteLine(api_url + " Data: " + data);
}
}
On run, anything after fetch.DownloadString(api_url) fails to display. I’m not convinced it’s doing anything at all. Commenting that line out (and removing the string from Console.WriteLine) allows it to continue. What am I doing wrong?
If it’s relevant, I’m compiling in Mono on OSX Lion.
Apologies! So, so sorry – apparently there was a network outage at my VPS host – half my machines were down, including my DNS somehow. I didn’t realize. Voting to close my question.
Nothing is wrong…. just that website, dev.phyre.im its taking a very very very long time. Just keep waiting, you will get a timeout exception