我究竟做错了什么?我没有收到任何错误消息,但它无法正常工作 -
代码部分:
int n = Convert.ToInt32(args.Content);
if (n >= 10000)
n = (int) (n - (n * 0.85));
return n.ToString();
仅当我评论代码的前一部分时才有效:
Match match = Regex.Match(args.Content, "ca.*?2013", RegexOptions.IgnoreCase);
if (match.Success)
args.Content = match.Groups[1].Value + "Aktl.";
return args.Content;
贝娄是完整的脚本:
using System;
using System.Text.RegularExpressions;
using VisualWebRipper.Internal.SimpleHtmlParser;
using VisualWebRipper;
public class Script
{
//See help for a definition of WrContentTransformationArguments.
public static string TransformContent(WrContentTransformationArguments args)
{
try
{
//Place your transformation code here.
//This example just returns the input data
Match match = Regex.Match(args.Content, "ca.*?2013", RegexOptions.IgnoreCase);
if (match.Success)
args.Content = match.Groups[1].Value + "Aktl.";
return args.Content;
int n = Convert.ToInt32(args.Content);
if (n >= 10000)
n = (int) (n - (n * 0.85));
return n.ToString();
}
catch(Exception exp)
{
//Place error handling here
args.WriteDebug("Custom script error: " + exp.Message);
return "Custom script error";
}
}
}