开发者

Maximum Image Uri Length in Silverlight

开发者 https://www.devze.com 2022-12-29 04:30 出处:网络
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 request

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...


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消