C# CodedUI测试发送键触发输入代码的CA1303

C# CodedUI测试发送键触发输入代码的CA1303,c#,code-analysis,coded-ui-tests,C#,Code Analysis,Coded Ui Tests,使用键的代码调用SendKeys时(例如“{ENTER}”),代码分析会触发以下错误: CA1303:不要将文字作为本地化参数传递 MS类库手册本身显示了在 除了抑制CA之外,还有什么好的解决方案吗?我对keycode文本使用托管类 public static class KeyCode { public static string Return { get { return "{ENTER}"; } } public static string Backspace { get {

使用键的代码调用SendKeys时(例如
“{ENTER}”
),代码分析会触发以下错误:

CA1303:不要将文字作为本地化参数传递

MS类库手册本身显示了在


除了抑制CA之外,还有什么好的解决方案吗?

我对
keycode
文本使用托管类

public static class KeyCode
{
   public static string Return { get { return "{ENTER}"; } }
   public static string Backspace { get { return "{BACKSPACE}"; } }
   public static string F1 { get { return "{F1}"; } }
   public static string PageDown { get { return "{PGDN}"; } }
   ...
   ..
   .
}

我对
keycode
文本使用托管类

public static class KeyCode
{
   public static string Return { get { return "{ENTER}"; } }
   public static string Backspace { get { return "{BACKSPACE}"; } }
   public static string F1 { get { return "{F1}"; } }
   public static string PageDown { get { return "{PGDN}"; } }
   ...
   ..
   .
}