小编Dav*_*dez的帖子

Mono WebClient 编码问题

我正在尝试将.NET应用程序从 Windows移植到 Mono,但是在 Windows 上运行的某些代码不再在mono上运行(如预期的那样):

WebClient client = new WebClient ();
Console.WriteLine (client.DownloadString("http://www.maxima.fm/51Chart/"));
Run Code Online (Sandbox Code Playgroud)

它似乎正确地将编码检测为 UTF-8(并且手动将编码设置为 UTF-8 或 ASCII 也不起作用)仍然存在“?” 人物

.net c# mono webclient

5
推荐指数
1
解决办法
2319
查看次数

非常慢的WebResponse触发TimeOut

我在C#中有一个函数,它通过从路由器页面检索64b XML来获取Internet的状态

public bool isOn()
        {
            HttpWebRequest hwebRequest = (HttpWebRequest)WebRequest.Create("http://" + this.routerIp + "/top_conn.xml");
            hwebRequest.Timeout = 500;
            HttpWebResponse hWebResponse = (HttpWebResponse)hwebRequest.GetResponse();
            XmlTextReader oXmlReader = new XmlTextReader(hWebResponse.GetResponseStream());       
            string value;
            while (oXmlReader.Read())
            {
                value = oXmlReader.Value;
                if (value.Trim() != ""){
                    return !value.Substring(value.IndexOf("=") + 1, 1).Equals("0");
                }
            }
            return false;

        }
Run Code Online (Sandbox Code Playgroud)

使用Mozilla Firefox 3.5和FireBug插件我猜测它通常需要30ms来检索页面,但是在非常大的500ms限制下它仍然经常达到它.如何显着提高性能?

提前致谢

c# xml httpwebrequest httpwebresponse

4
推荐指数
1
解决办法
4696
查看次数

JOOMLA 中的 TCPDF 库!组件以 PDF 格式输出 html

我在 joomla 中有一个组件可以导出为 PDF,我遇到的问题是导出的 PDF 不可读,因为 Joomla! 在pdf本身之后和之前插入的页面。

我已经制作了一个组件的标准结构并将其称为

index.php?option=com_listado_factura&task=exportar_pdf
Run Code Online (Sandbox Code Playgroud)

com_listado_factura组件的名称和exportar_factura导出为pdf的控制器的功能。

找遍了也没找到解决办法,谢谢

joomla components tcpdf

2
推荐指数
1
解决办法
2413
查看次数

标签 统计

c# ×2

.net ×1

components ×1

httpwebrequest ×1

httpwebresponse ×1

joomla ×1

mono ×1

tcpdf ×1

webclient ×1

xml ×1