我的 C# WIndows Forms 应用程序有一些指向 Web URI 的菜单链接。但现在我的 SonarQube Scan 给了我这个错误/警告(S1075)来重构我的代码。那么在 C# 后端代码中使用 Web URI 的安全/最佳方法是什么?
private void HelpDocMenu_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://docs.google.com/document/d/142SFA/edit?usp=sharing");
}
Run Code Online (Sandbox Code Playgroud)
SonarQube 错误
S1075 Refactor your code not to use hardcoded absolute paths or URIs
Run Code Online (Sandbox Code Playgroud)