我在服务器上上传网站时代码错误 [英] Error on code while i upload website on server

查看:59
本文介绍了我在服务器上上传网站时代码错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在本地系统上运行网站时,它运行完美.但是,当我在服务器上上传内容时,在某些页面上我们使用microsoft.mshtml.dll进行html解析时出现了错误.请帮助我解决我的问题.
创建错误的代码是:

when i run my website on local system then it work perfect. but when i upload content on server then i got error on some page where we use microsoft.mshtml.dll for html parsing. please help me to solve my problem.
Code That create error is :

<br />
string STR = "";<br />
        public string GetPlan(string html)<br />
        {<br />
            HTMLDocument htmlDoc = new HTMLDocument();<br />
            IHTMLDocument2 iHtmlDoc2 = null;<br />
            iHtmlDoc2 = (IHTMLDocument2)htmlDoc;  <br />
            iHtmlDoc2.designMode = "On";<br />
            iHtmlDoc2.write(html);  <br />
            iHtmlDoc2.close();<br />
            foreach (IHTMLElement htmlElem in (IHTMLElementCollection)iHtmlDoc2.body.all)<br />
            {<br />
                if (htmlElem is HTMLTable)<br />
                {<br />
                    HTMLTable table = htmlElem as HTMLTable;<br />
                    if (table != null && table.width.ToString() == "575")<br />
                        STR += table.innerHTML + "<BR/>";<br />
                    Console.WriteLine("Form element found: " + table.innerHTML);<br />
                }<br />
            }<br />
            return "g";<br />
        }<br />
       public string  getstring(string path)<br />
        {<br />
            WebRequest req = WebRequest.Create(path);<br />
            WebResponse res = req.GetResponse();<br />
            StreamReader sr = new StreamReader(res.GetResponseStream());<br />
            string html = sr.ReadToEnd();    <br />
            GetPlan(html);<br />
            return STR;<br />
        }<br />
<br />

推荐答案

This[^] is how you research error messages.

For more help from us, post the code that creates the error.


如果您的代码在localhost中完美运行,并在服务器中给出错误,则可以复制microsoft.mshtml.dll并粘贴在网站bin文件夹中.我希望能解决您的问题
if your code is run in perfect in localhost and give error in server then you copy the microsoft.mshtml.dll and paste in website bin folder. i hope solve your problem


这篇关于我在服务器上上传网站时代码错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆