Silverlight 中的最大图像 Uri 长度

发布于 2024-08-31 03:57:40 字数 171 浏览 6 评论 0原文

有谁知道 Silverlight 中的最大 URL 长度是多少(如果重要的话,版本 4)?我知道它是 2048 并且对于 Firefox 来说基本上是无限的(我测试过的两个环境),但是对于长 Uri 来说,图像请求会失败。任何人都知道这个神奇数字(最大文件路径长度是 256 吗?)它比 IE 的 2048 要短得多......

Does anyone know what the Maximum URL length is in Silverlight (version 4 if it matters)? I know it is 2048 and basically infinite for Firefox (the two environments I have tested in), but Image requests fail for long Uri's. Anyone know the magic number (is it 256 the max filepath length?) It is considerably shorter than the 2048 for IE...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心意如水 2024-09-07 03:57:40

根据 Silverlight 的 .NET 框架库 Uri 方案可以是 1024,而完整的 Uri 最长可达 65519 个字符。这对于 v3 和 v4 都有效。

希望这能给您一些指导。

编辑

好的,经过长时间的测试,我成功地找到了图像 URL 的限制。

该方案指的是http部分。

整个URI不能超过2047,之后它似乎不再加载图像。但是,我找不到其背后的任何官方理由。

您收到 AG_E_NETWORK_ERROR 异常的事实与 URI 的长度没有任何关系。

不过,您可以检查 URI 中是否存在非法字符:

项我还发现,如果链接放置在 XAML 中,您必须替换“&”与其对应的“%26”进行签名。

According to the .NET framework library for Silverlight The Uri scheme can be 1024 while a complete Uri can be up to 65519 characters long. This is valid for both v3 and v4.

Hope this gives you some guidance.

EDIT

Okay, well after long testing, I managed to track down the limit for an image URL.

The scheme refers to the http part.

The whole URI cannot be longer than 2047 after which it seems to not load the image anymore. However, I could not find any official reasoning behind it.

The fact that you are getting AG_E_NETWORK_ERROR exceptions does not have anything to do with the length of the URI.

You can check however, if there are any illegal characters in your URI:

  • You can find the reserved characters in RFC2369 and see their web counterparts at w3schools

I also found that if the link is placed in the XAML, you have to replace the '&' sign with its '%26' counterpart.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文