WebClient DownloadData问题 [英] WebClient DownloadData problem

查看:370
本文介绍了WebClient DownloadData问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用WebClient.DownloadData类访问一个网址。 URl包含xml数据作为查询字符串。但是当xml大小增加时,它会给出PathTooLongException。但它适用于小尺寸的xml。



任何建议我如何通过url传递大型xml或如何改进我的逻辑。



谢谢,

Amit

Hi,

I am using WebClient.DownloadData class to access one url. URl contains xml data as a query string. But when the xml size increases it gives PathTooLongException. But it works fine with small size of xml.

Any suggestion how can i pass large xml with url or how to improve on my logic.

Thanks,
Amit

推荐答案

如果你正确识别了异常类型(我不知道)为什么不这样),这与某些XML的大小无关,而是与某些文件路径有关。请参阅:

http://msdn.microsoft.com /en-us/library/system.io.pathtoolongexception.aspx [ ^ ]。



这是一个众所周知的问题。您将在此处找到一个有趣且整洁的解决方法: http://bcl.codeplex.com/releases/view/42783 [ ^ ]。



-SA
If you identified the exception type correctly (I don''t see why not), this is not at all related to the size of some XML, but to some file path. Please see:
http://msdn.microsoft.com/en-us/library/system.io.pathtoolongexception.aspx[^].

This is a well-known problem. You will find one interesting and neat workaround here: http://bcl.codeplex.com/releases/view/42783[^].

—SA


这篇关于WebClient DownloadData问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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