Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这段代码有什么问题?我收到此错误:“分配给 '....' 的表达式必须是常量”
public const string ConnectionString = System.IO.File.ReadAllText(@"D:\connection.ini");
必须在编译时知道一个常量值,使用 readonly 代替,它会产生类似的效果