.NET 紧凑框架中的 URI 操作

发布于 2024-08-16 06:47:24 字数 186 浏览 1 评论 0原文

在 .NET 紧凑框架中操作 URI 的最佳方法是什么?我基本上需要加载一个 URL 字符串,然后允许用户更改“Scheme”和“Host”值。到目前为止,我一直在使用 Uri 类,但它本质上是不可变的,因此一旦初始化,您就无法真正修改 Uri 的任何组件。

UriBuilder 看起来像是最好的解决方案,但它似乎并不存在于紧凑的框架中。

What's the best way to manipulate URIs in .NET compact framework? I basically need to load up a URL string, then allow the user to change the "Scheme" and "Host" values. I've been using the Uri class so far, but it's essentially immutable, so you can't really modify any of the components of the Uri, once it's initialized.

The UriBuilder looked like it would be the best solution, but it does not seem to exist in the compact framework.

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

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

发布评论

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

评论(2

何以心动 2024-08-23 06:47:24

我不知道紧凑框架中存在 UriBuilder 的替代方案。您最好的选择可能是使用您需要的功能创建自己的 UriBuilder,以便在紧凑框架中使用。

I don't know of an alternative to UriBuilder, that exists in the compact framework. Your best bet would probably be to create your own UriBuilder with the functionality you need, for use in the compact framework.

起风了 2024-08-23 06:47:24

您可以使用 CodeProject 中的这个 UrlBuilder 类:

http:// www.codeproject.com/KB/aspnet/UrlBuilder.aspx

You could use this UrlBuilder class from CodeProject :

http://www.codeproject.com/KB/aspnet/UrlBuilder.aspx

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