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
精彩评论