-4
我想製作一個連接到在線數據庫的程序。我提出的PHP文件,該文件顯示了數據,但我想打開URL並獲取HTML源代碼中,如:使用c語言編程獲取文件字體格式url
這個代碼CSHARP:
using System.Net;
using (WebClient client = new WebClient())
{
string htmlCode = client.DownloadString("http://example.com/a.html");
}
這個代碼在python:
import urllib2
url = 'http://example.com' # write the url here
usock = urllib2.urlopen(url)
data = usock.read()
usock.close()
print data
我該如何將這些代碼寫入c語言中?
這個網站是不是一個代碼翻譯服務。 – 2014-08-29 21:17:33
你的問題絕對是操作系統特定的。 – 2014-08-29 21:39:26