以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 請求指導 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=74426) |
-- 作者:catyin1989 -- 发布时间:2015/9/10 16:41:00 -- 請求指導 很想寫一個翻譯的功能,但是這些碼看不懂,請求大大幫忙把這些碼轉成 VB 或是 foxtable T^T https://msdn.microsoft.com/en-us/library/ff512421.aspx
|
-- 作者:大红袍 -- 发布时间:2015/9/10 17:15:00 -- Mark 百度翻译API
Dim text As String = "Use pixels to express measurements for padding and margins." Dim client_id As String = "hAaa2NLELKdAIfMhMjnuEgi1"
Dim url As String= "http://openapi.baidu.com/public/2.0/bmt/translate?client_id=" & client_id & "&q=" & text & "&from=" & from & "&to=" & [To] Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url) Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse Dim stm As System.IO.Stream = rsps.GetResponseStream() Dim reader As New System.IO.StreamReader(stm) Dim str As String = reader.ReadToEnd rsps.Close
|
-- 作者:catyin1989 -- 发布时间:2015/9/10 17:52:00 -- 超級感謝的!!!!! >^< |
-- 作者:catyin1989 -- 发布时间:2016/2/21 17:42:00 -- 現在百度翻譯的網址好像不同了, 原碼不能用?? 能有新的code可用嗎?? T^T |
-- 作者:大红袍 -- 发布时间:2016/2/21 18:48:00 -- 注册成为百度开发者,然后参考
http://api.fanyi.baidu.com/api/trans/product/apidoc
MD5加密参考
msgbox(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("加密内容", "MD5"))
随机数参考
http://www.foxtable.com/help/topics/0349.htm
|
-- 作者:catyin1989 -- 发布时间:2016/2/21 19:11:00 -- 必須用大陸的手機碼注冊.... |
-- 作者:大红袍 -- 发布时间:2016/2/21 22:16:00 -- 如下代码,appid和key最好还是你自己注册一个
Dim q As String = "Use pixels to express measurements for padding and margins." Dim text As String = appid & q & salt & key Dim ScriptControl As Object, data As Object, JscriptCode As String Dim url As String= "http://api.fanyi.baidu.com/api/trans/vip/translate?q=" & text & "&from=" & from & "&to=" & [To] & "&appid=" & appid & "&salt=" & salt & "&sign=" & sign Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url) Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse Dim stm As System.IO.Stream = rsps.GetResponseStream() Dim reader As New System.IO.StreamReader(stm) Dim str As String = reader.ReadToEnd rsps.Close
|
-- 作者:catyin1989 -- 发布时间:2016/2/22 14:57:00 -- Dim sign As String = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(text, "MD5") 這句出 error, 說 security is not a member of web, 應如何更改?? |
-- 作者:大红袍 -- 发布时间:2016/2/22 14:58:00 -- 添加引用那里,填入 System.Web.Dll
http://www.foxtable.com/help/topics/1936.htm
|