我正在编写一个类,它将用于将数据发布到 twitter。有人可以澄清此功能是否可以安全共享吗?当一个功能不能安全共享时仍然很难掌握。不幸的是..!
它将返回一个基本字典,然后我可能会在检索到基本签名后添加其他参数。
Private Shared Function createbasesignature() As SortedDictionary(Of String, String)
Dim oauth_nonce = Convert.ToBase64String(New System.Text.ASCIIEncoding().GetBytes(DateTime.Now.Ticks.ToString()))
Dim timeSpan = DateTime.UtcNow - New DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)
Dim oauth_timestamp = Convert.ToInt64(timeSpan.TotalSeconds).ToString()
Return New SortedDictionary(Of String, String) From { _
{"oauth_consumer_key", ConfigurationManager.AppSettings("twitter_consumer_key")}, _
{"oauth_nonce", oauth_nonce}, _
{"oauth_signature_method", "HMAC-SHA1"}, _
{"oauth_timestamp", oauth_timestamp}, _
{"oauth_version", "1.0"} _
}
End Function