English 中文(简体)
WebClient (). downloadString () 挂在 C# [关闭]
原标题:WebClient().DownloadString () hangs in C# [closed]

我是PHP开发商,试图教自己C#。我有以下测试代码:

//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);
    }


}

运行中, 在 < code> fetch. downloadString( api_url) 之后的任何内容都无法显示。 我完全不相信它正在做任何事情。 注释该行( 并从控制台删除字符串. writeLine) 允许它继续 。 我做错什么了?

如果相关的话,我在《OSX狮子》的《莫诺书》中编辑。


抱歉,所以,对不起,显然我的VPS主机有网络故障, 一半的机器都坏了, 包括我的DNS。我不知道。投票结束我的问题。

最佳回答

没什么错 只是网站 Dev.phyre.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签