【发布时间】:2016-10-13 12:49:14
【问题描述】:
我尝试向 Torrent Tracker 发送 HTTP 请求,该请求必须使用此表单:
bt1.archive.org
GET /announce?info_hash=ACC3B2E433D7C7475ABB5941B5681CB7A1EA26E2 HTTP/1.1
Host: bt1.archive.org
Connection: keep-alive
Accept: text/html
User-Agent: CSharp
但是info_hash参数必须是UrlEncoded,而且必须是:%AC%C3%B2%E4%33%D7%C7%47%5A%BB%59%41%B5%68%1C%B7%A1%EA%26%E2,所以我用
System.Net.WebUtility.UrlEncode(info_hash)
并且输出与输入相同。 我觉得这个问题的答案很明显,但是我没有找到……
【问题讨论】:
-
也许这会起作用:
System.Net.WebUtility.UrlEncode(sha1.ComputeHash(BencodeUtility.Encode(kvp.Value).ToArray()))
标签: c# .net url bittorrent torrent