Конвертирование VBScript в C# [требует правки]

335
20 августа 2017, 03:21

Есть код VBScript, нужно его конвертировать в C#, но в VBS я 0, поможет кто?

Dim o, WFLogin, WFPassword, WFToken, WFUid, WFSessionKey, WFPersId, WFKey, wsh
WFLogin = "login"
WFPassword = "password"
Set o = CreateObject("Microsoft.XMLHTTP")
o.open "POST", "https://authdl.mail.ru/ec.php?hint=GcAuth", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><GcAuth Username="""&WFLogin&""" Password="""&WFPassword&""" ChannelId=""0""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><GcAuth Username="""&WFLogin&""" Password="""&WFPassword&""" ChannelId=""0""/>"
Set xmlParser = CreateObject("Msxml2.DOMDocument")
xmlParser.loadXML(o.responsetext)
WFToken = xmlParser.getElementsByTagName("GcAuth").Item(0).getAttribute("Token")
WFUid = xmlParser.getElementsByTagName("GcAuth").Item(0).getAttribute("Uid")
WFSessionKey = xmlParser.getElementsByTagName("GcAuth").Item(0).getAttribute("SessionKey")
o.open "POST", "https://authdl.mail.ru/ec.php?hint=EnazaGetOrdersList", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><EnazaGetOrdersList Uid="""&WFUid&""" SessionKey="""&WFSessionKey&""" UidType=""3""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><EnazaGetOrdersList Uid="""&WFUid&""" SessionKey="""&WFSessionKey&""" UidType=""3""/>"
o.open "POST", "https://authdl.mail.ru/sz.php?hint=AutoLogin", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><AutoLogin ProjectId=""1177"" SubProjectId=""0"" ShardId=""1"" GcToken="""&WFToken&"""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><AutoLogin ProjectId=""1177"" SubProjectId=""0"" ShardId=""1"" GcToken="""&WFToken&"""/>"
xmlParser.loadXML(o.responsetext)
WFPersid = xmlParser.getElementsByTagName("AutoLogin").Item(0).getAttribute("PersId")
WFKey = xmlParser.getElementsByTagName("AutoLogin").Item(0).getAttribute("Key")
Set wsh = WScript.CreateObject("WScript.Shell")
wsh.Exec("Game.exe --shard_id=0 +online_server s0.warface.ru -uid "&WFPersid&" -token "&WFKey&" ")
READ ALSO
Замена Graphics.DrawLine на DrawingContext.DrawLine

Замена Graphics.DrawLine на DrawingContext.DrawLine

Имеется код, который нормально работает в WinForms, но хочется перенести его в WPF

227
DigitalProductId не всегда находит

DigitalProductId не всегда находит

Пытаюсь получить ключ продукта windows, на win 7 работает нормально, но на других осях не показывает

243
Не публикуется asp.net core проект

Не публикуется asp.net core проект

Поставил VS2017 pro, обнаружил, что не работает кнопка опубликовать, те

215