开发者

Visual Basic equivalent to file get contents?

Is there a function in Visual Basic that does the same thing as file_get_contents in PHP. I'm a PHP programmer, and I want to write a few scripts to dow开发者_StackOverflownload some data from an API I'm using.


In VB.Net (I'm assuming that's what you're looking for), I think you'd want to look at the WebClient.DownloadFile method (http://msdn.microsoft.com/en-us/library/ez801hhe.aspx) if the file you want is on the web. If it's a local file you could use...

My.Computer.FileSystem.ReadAllText("C:\test.txt")

I'm not familiar with PHP's file_get_contents but if it's asynch you can call WebClient.DownloadFileAsync

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜