查找所有源硬编码字符串

12

本文介绍了查找所有源硬编码字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我需要将源代码中的所有硬编码字符串移动到 .resx 文件中.是否有工具可以帮助我找到 C# 代码中的所有硬编码字符串?

I need to move all the hard coded strings in my source code in .resx files. Is there a tool that could help me find all the hardcoded strings within C# code?

推荐答案

ReSharper 5 显然是一个选择,但必须设置许多技巧才能实现目标,

ReSharper 5 is obvious a choice, but many tips must be set so as to achieve your goals,

  1. 开启解决方案范围的分析.
  2. 转到 ReSharper|选项|代码检查|检查严重性|潜在的代码质量问题|元素可本地化设置为显示为错误.
  3. 返回解决方案资源管理器并单击项目 (csproj).
  4. 在 ReSharper 类别下的属性"面板中,将 Localizable 设置为 Yes,将 Localizable Inspector 设置为 Pessimistic.

然后你可以在解决方案面板的错误中找到几乎所有你需要的东西.

Then you can find almost all you need in Errors in Solution panel.

希望这会有所帮助.

这篇关于查找所有源硬编码字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

参数计数与调用不匹配?
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)...
2023-11-11 C#/.NET开发问题
26

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

没有 EndInvoke 的 C# 异步调用?
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)...
2023-11-11 C#/.NET开发问题
2

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14