| ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > Instance Class : ChangeRequest Method |
Type: System.String
The regex string to find the request url.
Type: System.Collections.IEnumerable
Collection of regexs to find data in the request body.
Type: System.Collections.IEnumerable
Collection of strings to replace the relevant data.
Type: System.Boolean
The true if use this replacement all time; otherwise and default, false.
public void ChangeRequest( string regexUrl, IEnumerable<string> regexesForReplace, IEnumerable<string> datasForReplace, bool allTime )
Type: System.String
The regex string to find the request url.
Type: System.Collections.IEnumerable
Collection of regexs to find data in the request body.
Type: System.Collections.IEnumerable
Collection of strings to replace the relevant data.
Type: System.Boolean
The true if use this replacement all time; otherwise and default, false.
To find the request use regex "regexUrl". To replace data in the request body use collections "regexesForReplace" and "datasForReplace", the first collection contains regular expressions that will replace the original data with the corresponding elements from the second collection. The "regexesForReplace" and "datasForReplace" collections should has a same size, otherwise the method doesn't perform and set ErrorDetected to True.
instance.ChangeResponse("http://lessons.zennolab.com/en/index", new List<string> { "(?<=<input type =\"checkbox\" class=\"inputs\"><h2> ).*(?=</h2>)", "(?<=<textarea rows =\"5\" cols=\"45\" name=\"text\">).*(?=</textarea>)", "<h2>Any text:</h2>" }, new List<string> { "no OS", "NEW TEXT TO TEXTAREA", "<h2>NEW HEADER TO TEXTAREA:</h2>" }); instance.ChangeRequest(@"(?<=https://mc\.yandex\.ru/webvisor/).*", new List<string> { @"(?<=wv-data=).*" }, new List<string> { "NODATA" }, true); Tab tab = instance.ActiveTab; if ((tab.IsVoid) || (tab.IsNull)) return -1; if (tab.IsBusy) tab.WaitDownloading(); tab.Navigate("lessons.zennolab.com", ""); if (tab.IsBusy) tab.WaitDownloading();
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.