- #light
- open System.Net
- open System
- open System.IO
- open Printf
- /// Fetch the contents of a web page
- let http(url: string) =
- let req = System.Net.WebRequest.Create(url)
- let resp = req.GetResponse()
- let stream = resp.GetResponseStream()
- let reader = new IO.StreamReader(stream)
- let html = reader.ReadToEnd()
- resp.Close()
- html
- let live = http("http://www.google.com")
- printf "%s"live
- System.Console.ReadKey(true);
F# System.Net.WebRequest GetResponse
最新推荐文章于 2024-01-21 15:06:00 发布