查询字符串中的通配符 C#
不知道如何问这个问题或者是否可以做到。
我有一个 ID 号,我想测试它是否与存储在我正在使用的 API 中的 URL 查询字符串中的 ID 匹配。
因此,如果我要搜索的 URL 包含 http://www.testurl.com/page?key=55555
,我只想在该 url“包含”该数字时放入我的 http 请求。测试 url 是否完全相等已被证明是有问题的,因为存储的查询字符串还有很多其他信息。
考虑到我已经对 html 进行了编码,查询字符串中的通配符是否可能?任何帮助表示赞赏。谢谢你!
Not sure how to ask this or if it can be done.
I have an ID number, that I want to test if it matches an ID in a URL query string that is stored in an API I am working with.
So if the URL i want to search contains a http://www.testurl.com/page?key=55555
, I just want to put in my http request if that url 'contains' that number. Testing if the url is exactly equal has proved problematic as there is a lot of other info the stored query string.
Are wildcards within query strings even possible, considering I am encoding the html already? Any help is appreciated. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您可以访问 QueryString,您可以这样做:
If you can access the QueryString, you could just do this: