config文件节选:
        <Core 
            defaultLanguage
="zh-CN" 
            filesPath
="/" 
            disableEmail
="false"
            disableIndexing
="false" 
            disableThreading
="false"
            cacheFactor
="5"
            smtpServerConnectionLimit
="-1"
            enableLatestVersionCheck
="true"
            systemType 
= "Self"
            backwardsCompatiblePasswords 
= "true"
            textEditorType 
= "Openlab.FreeTextBoxWraper.FTB, Openlab.CSAddOns" 
            requireSSL 
= "false"
            defaultRoles 
= "Everyone;Registered Users" 
            wwwStatus 
= "Ignore"
            AttachmentsPath 
= "~/Attachments/"
            AvatarsPath 
= "~/Avatars/Uploads/"
            AttachmentSaveMode 
= "Disk"
            AvatarSaveMode 
= "Disk"
        
>

 enum类型:

    /// <summary>
    
/// 附件保存模式——磁盘、数据库
    
/// </summary>
    public enum FileSaveMode 
    {
        
/// <summary>
        
/// 数据库
        
/// </summary>
        DataBase,
        
/// <summary>
        
/// 磁盘
        
/// </summary>
        Disk
    }

读取config中的值


            att 
= attributeCollection["AttachmentSaveMode"];
            
if(att != null)
            {
                
try
                {
                    attachmentSaveMode 
= (FileSaveMode)Enum.Parse(typeof(FileSaveMode), attributeCollection["AttachmentSaveMode"].Value);
                }
                
catch{}
            }
posted on 2006-03-06 14:08  今夜太冷  阅读(2065)  评论(1)    收藏  举报