My是个环境变量,在C#没有相对应的关键字。
如楼上所示,使用System.Configuration.ConfigurationManager.AppSettings
来访问AppSetting中的配置集合。
如果是Web.Config,则用System.Web.Configuration命名空间。
对于Resources,通常的可以使用楼上的方式。不过如果你自定义了程序集的默认命名空间,需要使用那个命名空间。
=========================================
你可以试下如下代码,我估计你说的是这个问题。
Console.WriteLine(Settings.Default.Server);
Settings是你程序的配置,前面还有你程序集的默认命名空间。
Default是默认配置。
Server是配置项。
My命名空间是VB.NET独有的,C#中没有与之等价的语句,但可以通过自己编写代码模仿其中的某些功能。
My.Computer.FileSystem.ReadAllText()
等价于
File.ReadAllText(string filename)静态方法。
app.config用 System.Configuration.ConfigurationManager.AppSettings
Resources用
Properties.Resources
my相当于C#中的this关键字