English 中文(简体)
MVC3 VS2010 申请条件
原标题:MVC3 VS2010 Application Settings i9mplementation

我有一个使用VS2010的MVC2C#.Net网络。 The Below is an entry in y web.config:

<configuration>
     <applicationSettings>
       <BOE.My.MySettings>
         <setting name="AppBackColor" serializeAs="String">
           <value>AntiqueWhite</value>
         </setting>
       </BOE.My.MySettings>
     </applicationSettings>
</configuration>

然而,在我的控制人档案中,我的解决者AppBackColor未被承认。 任何想法?

var backColor= My.Settings.AppBackColor

我在这里做了什么错误?

最佳回答

这部桌面应用程序不足。 在网络应用中,你没有利用这种环境。

You could use the <appSettings> section of your web.config to store custom values:

<appSettings>
    <add key="foo" value="bar" />
</appSettings>

页: 1

var foo = ConfigurationManager.AppSettings["foo"];
问题回答

暂无回答




相关问题
C# multiple settings files with same interface

I m trying to create a program with two (or more) discrete sets of settings, that both conform to the same interface. Particularly I d like to do something like the following, using designer ...

Change namespace of a deployed clickonce application

I made a bit of a namespace spelling mistake and I wish to correct it. My application currently uses Application.Settings to store a bulk of the user s information. If I refactor my namespace to be ...

How to enable-disable Notifications in settings app using sdk?

I want to use push notification in my app so first time it launches it will automatically ask for notification.So i want to enable-disable push notification settings for my app programmatically.Note-I ...

Application Settings saving

I have two assemblies in my application. MyApplication.BO and MyApplication.GUI. I have configured property-settings for my BO assembly. Now when I am trying to compile the following code: public ...

Shared Windows-Application settings file (*.settings)?

I develop a desktop application that will be installed in few stations in the local network, I want the *.settings to fetch the settings from the DB when the program loads, the save it on SaveChanges. ...

iPhone settings bundle

I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: ...

热门标签