Exemplo n.º 1
0
 protected void btnUpload_Click(object sender, EventArgs e)
 {
     if (fuFile.PostedFile.ContentLength > 0)
     {
         string path     = "Uploads";
         string filename = Path.GetFileName(fuFile.PostedFile.FileName);
         SiteFiles.AddFile(fuFile.PostedFile.InputStream, path, filename);
         Page.ClientScript.RegisterStartupScript(this.GetType(), "InsertMedia",
                                                 string.Format("<script type=\"text/javascript\">\n// <![CDATA[\nProcessContent('{0}');\n// ]]>\n</script>", GetEmbedCode(path, filename)));
     }
 }
    public void btnPost_Click(object sender, EventArgs e)
    {
        SiteSettings settings = SiteSettingsManager.GetSiteSettings();

        settings.Copyright             = this.txtCopyright.Text.Trim();
        settings.SearchMetaDescription = this.txtSearchMetaDescription.Text.Trim();
        settings.SearchMetaKeywords    = this.txtSearchMetaKeywords.Text.Trim();
        settings.SiteDescription       = this.txtSiteDesc.Text.Trim();
        settings.SiteName       = this.txtSiteName.Text.Trim();
        settings.CompanyIdea    = this.txtIdea.Text;
        settings.CompanyService = this.txtService.Text;
        settings.CompanyICP     = this.txtICP.Text.Trim();
        settings.ServiceTel     = this.txtServiceTel.Text.Trim();
        if (fuShow.PostedFile != null && fuShow.PostedFile.ContentLength > 0)
        {
            settings.ShowPicture = Path.GetFileName(fuShow.PostedFile.FileName);
            SiteFiles.AddFile(fuShow.PostedFile.InputStream, "ShowPicture", settings.ShowPicture);
        }
        SiteSettingsManager.Save(settings);
        mbMessage.ShowMsg("修改站点信息成功!", Color.Navy);
        BindData();
    }