转换VBscript到VB.Net或c# . Net

本文关键字:Net VB VBscript 转换 | 更新日期: 2023-09-27 18:12:51

是否有工具可以将VBscript代码转换为VB.net代码或c# .net代码?

这是我想转换的示例代码

Dim googleTime, googleDt, googleScheme
googleTime = DateDiff("s", "01/01/1970 00:00:00", Now())
googleDt = (1000 * googleTime) + Round(1000 * (Timer - Int(Timer)))
googleScheme = "http://"
googleUserAgent = Server.URLEncode(Request.ServerVariables("HTTP_USER_AGENT"))
If StrComp(Request.ServerVariables("HTTPS"), "on") = 0 Then googleScheme = "https://"

例如定时器在VBscript我没有找到任何等效的在VB。网请建议。

转换VBscript到VB.Net或c# . Net

" Timer函数返回从12:00 AM开始的秒数和毫秒数。"

http://www.w3schools.com/vbscript/func_timer.asp

DateTime.Now.Subtract(DateTime.Today).TotalMilliseconds

是等价的