English 中文(简体)
Uri.TryCreate,什么错?
原标题:Input parameter for Uri.TryCreate, what s wrong?

我们下载的超文本页面很少,链接中断(相对途径),我们每个网页的原文是URL。

We are converting all relative links to Absolute links using -

Foreach (anchorElement in page) -
    Uri.TryCreate( originalPageURI, hrefRelativeURI, hrefAbsoluteURI )

除以下案件外,大多数案件都是如此:

originalPageURI = http://somewebsite.com/post.jsp?item=22

hrefRelativeURI = ?item=97

在<代码>TryCreate(>失败的情况下,>的输入参数是什么?

最佳回答

You can t solve your problem with Uri because ?item=97 is not a relative path but instead a query string.

因此,你必须做的是,用手方式来构筑你的新力量。

您应使用:

  • www.un.org/chinese/ga/president 你们可以加入“真实”的相对途径,以获得绝对的内涵(即不从<代码>开始的人:)。

  • 。 你们可以走到这个部分的“false”相对道路。 这些错误是代表问询参数(即从<代码>开始的参数?)。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签