Invalid Richtextbox C # file format

Error: File format is not valid in Richtextbox.

My code is here:

var webClient = new WebClient(); //Make sure to reference System.Net richTextBox1.Rtf = webClient.DownloadString("http://koolkool.freevnn.com/tool/Documents/invitePK.rtf") 

Please help me. Image error here: enter image description here

+4
source share
1 answer

Ok, let's use PowerShell and see what you actually download:

  PS> $ wc = New-Object System.Net.WebClient
 PS> $ wc.DownloadString ("http://koolkool.freevnn.com/tool/Documents/invitePK.rtf")
 <html> <body> <script type = "text / javascript" src = "/ aes.js"> </script> <script> function toNumbers (d) {var e = []; d.replace (/ (.
 .) / g, function (d) {e.push (parseInt (d, 16))}); return e} function toHex () {for (var d = [], d = 1 == arguments.length && arguments [0 ] .co
 nstructor == Array? arguments [0]: arguments, e = "", f = 0; f <d.length; f ++) e + = (16> d [f]? "0": "") + d [f ] .toString (16); return e.toLowerC
 ase ()} var a = toNumbers ("f655ba9d09a112d4968c63579db590b4"), b = toNumbers ("98344c2eee86c3994890592585b49f80"), c = toNumbers ("
 e1b925425726f4245ffe50e9fafc1f50 "); document.cookie =" __ test = "+ toHex (slowAES.decrypt (c, 2, a, b)) +";  expires = Thu, 31-Dec-37
 23:55:55 GMT;  path = / "; location.href =" http://koolkool.freevnn.com/tool/Documents/invitePK.rtf?ckattempt=1 "; </script> <nos
 cript> This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript
 support </noscript> </body> </html>
 PS>

Oops It seems that RichTextBox does not know what to do with this HTML string. Bad server. I request a .rtf resource and you give me a javascript jack?

+5
source

All Articles