Announcement

Collapse
No announcement yet.

NameValueSectionHandler

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • NameValueSectionHandler

    hallo momentan beschäftige ich mich mit config-dateien was eine sehr
    spannende sache ist. leider habe ich ein problem bei dem icxh nicht weiter
    weiß:

    ich habe eine einfache c# windowsanwendung und eine gleichnamige configdatei
    im verzeichniss des assembly.

    in meiner anwendung gibt es volgende methode die im construktor aufgerufen
    wird:
    Code:
    private void InitSkin()
    {  
    IDictionary form = (IDictionary)ConfigurationSettings.GetConfig"skin/form");  
    this.Text = (string)form["Title"];  
    this.BackColor = Color.FromName((string)form["BackGround"]);  
    IDictionary button = (IDictionary)ConfigurationSettings.GetConfig"skin/button");
    this.btnAdd.BackColor =Color.FromName((string)
    button["AddButtonColor"]);
    this.btnDel.BackColor = Color.FromName((string)
    button["DelButtonColor"]);  
    IDictionary textfield= (IDictionary)
    ConfigurationSettings.GetConfig("skin/textfield");
    this.txtUserName.BackColor = Color.FromName((string)
    textfield["UserNameTextFieldColor"]);  
    this.txtGroup.BackColor =Color.FromName((string)textfield["GroupTextFieldColor"]);
    }
    die exe trägt den namen "MyThirdConfig.exe"
    die config trägt den namen "MyThirdConfig.exe.config"
    und sieht von innen so aus

    Code:
    <configuration>  
    <configSections>    
    <sectionGroup name="skin">      
    <section name="form"        type="System.Configuration.NameValueSectionHandler,              system,               
    Version=1.0.3300.0,              
    Culture=neutral,              
    PublicKeyToken=b77a5c561934e089"/>      
    <section name="button"        type="System.Configuration.NameValueSectionHandler,              system,               
    Version=1.0.3300.0,              
    Culture=neutral,              
    PublicKeyToken=b77a5c561934e089"/>      
    <section name="textfield"        type="System.Configuration.NameValueSectionHandler,              system,               
    Version=1.0.3300.0,              
    Culture=neutral,              
    PublicKeyToken=b77a5c561934e089"/>    
    </sectionGroup>  
    </configSections>  
    <skin>    
    <form      
    Title ="Administrator Console User.Library"      
    BackGround ="Wheat"/>    
    <button      
    AddButtonColor="LimeGreen"      
    DelButtonColor = "Red"/>    
    <textfield      
    UserNameTextFieldColor = "Gold"      
    GroupTextFieldColor = "Khaki"/>  
    </skin>
    </configuration>
    beim starten des Programmes bekomme ich immer die fehlermeldung

    "Cold not createSystem.Configuration.NameValueSectionHandler , system,
    Version=1.0.3300.0,
    Culture=neutral,
    PublicKeyToken=b77a5c561934e089"

    was mach ich da nur falsch oder ist der
    publicKeyToken falsch??bitte helft mir
    vielen dank gruß dica

  • #2
    <a href="www.opus.de">test<a&gt

    Comment

    Working...
    X