c# - 清除重复的查询字符串值 asp.net
问题描述
我想使用查询字符串中的值创建并命名一个文件夹。例如:
api/controller?lotid=value&operation=value
调试应用程序后(如下图),我意识到我测试的每个请求都变成了一个集合。结果,我怀疑该文件夹被命名(Collection)_(Collection)
而不是查询字符串 values lotid_operation
。
知道为什么会这样吗?
这就是我在控制器文件中获取查询的方式
public string Get(string lotid, string operation) {
//Secrets
}
在这里我创建文件夹名称
string folderName = lotid + "_" + operation;
以及 AbsoluteUri 在调试器面板中的外观
http://localhost:5000/api/otdash?lotid=XBSs&operation=xhr1&lotid=S23B&operation=xhr1&lotid=SWB45&operation=xhr1&lotid=SWB556&operation=34s&lotid=SD23&operation=xhr1&lotid=322&operation=3sl&lotid=%27sdfa%27&operation=%27ada%27&lotid=%27SWBT12 %27&operation=%27xhr1%27&lotid=%27SWEB000%27&operation=%27xhr1&lotid=%27RESS0292%27&operation=%27das%27&lotid=SBBB&operation=sasc&lotid=%27ssss%27&operation=%27A34%27
解决方案
推荐阅读
- azure - 我可以使用自定义策略为 MFA 使用两个电子邮件地址吗?
- api-platform.com - 无法访问服务器上的管理界面
- ios - 无需调用处理程序块即可满足通知的期望
- angular - ngOnChanges 未被调用,但视图已正确更新
- angular - Angular 中连续 HTTP 请求的动态数量
- python - 对来自两个不同 JSON 文件的具有相同 ID 的对象进行分组
- javascript - Chart.js,你能覆盖图例标签框的颜色吗?
- wordpress - 如何让 WordPress 评论审核电子邮件仅发送给网站管理员
- deep-learning - 使用什么算法将我的数据分类为 3 类
- django - 如何从模型中预填充 Django 表单