如何用Fiddler(脚本)编辑URL?

时间:2014-11-05 16:48:05

标签: c# fiddler

我想使用fiddler编辑网址。不必使用小提琴脚本,但这是我目前如何做到的近似值:

if (oSession.url.contains("example.com") {
  String oldUrl = oSession.url.ToString();
  Regex rgx = new Regex("1.2");
  String newUrl = rgx.Replace(oldUrl, "1.0");
}

此代码在regex实例化行上给出了编译器错误:"属性列表不适用于当前上下文"。我不完全确定这意味着什么。

我也不确定如何更改网址。

有什么想法吗?

2 个答案:

答案 0 :(得分:4)

得到它:

oSession.url = oSession.url.Replace("1.2","1.0");

答案 1 :(得分:0)

您也可以使用

    oSession.PathAndQuery = oSession.PathAndQuery.replace('/test1/', '/changed1/');  
相关问题