1

有没有办法在 f# 中获取 URL 和进一步的参数值只有 F# 任何人都可以帮助我。我尝试了很多但没有找到解决方案

http://www.example.com/blog?blogid=23

想获取http://www.example.com/blog?blogid=23

然后 23

4

2 回答 2

3
let getBlogId uriString =
    let uri = System.Uri(uriString)
    let kvps = HttpUtility.ParseQueryString uri.Query
    let idStr = kvps.["blogid"]
    int idStr
于 2014-10-22T20:49:33.890 回答
-1
let uri = new System.Uri("http://www.example.com/blog?blogid=23")
let blogId = uri.Query.Split('=').[1]
于 2014-10-22T20:51:48.530 回答