FreeTextBox使用详解
Author: Annerose Date:12/16/2005
版本: FreeTextBox 3.1.1 ASP.NET1.1
1.下载 FreeTextBox 3.1.1 (released 2005/11/08)
http://www.freetextbox.com/downloads.aspx
2. 安装
FreeTextBox 3.0以上版本均支持内部模式,即图片资源和javascript都集成在dll中, 本文仅探讨内部模式(Internal Resources).
1) 把FTBv3-1-1\Framework-1.1\FreetextBox.dll拷入bin目录.
2) 在项目中添加FreetextBox.dll的dll引用
3) Web.config加入如下代码

2

3

4

5

6

7

8

3. 使用FreeTextBox
1) aspx页面顶上
2) 调用
3)工具栏皮肤
4) 得到保存编辑的内容
2 {
3 // 指向同一个委托
4 this.FreeTextBox1.SaveClick += new System.EventHandler this.FreeTextBox1_SaveClick);
5 this.Button1.Click += new System.EventHandler(this.FreeTextBox1_SaveClick);
6 }
7
8 private void FreeTextBox1_SaveClick(object sender, System.EventArgs e)
9 {
10 divshow.InnerHtml = FreeTextBox1.Text;
11 }
5) 客户端中检测到有潜在危险的 Request.Form 值

4 图片上传
1) 工具栏上添加ImageGallery按钮.
2) 拷贝 "ftb.imagegallery.aspx" 文件到同一目录下
http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ImageGallery
3) FreeTextBox 属性设置
ImageGalleryPath = "~/image/upload" 上传默认路径
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}" ftb.imagegallery.aspx的目录, 只能用相对目录,不可以用"~"
4) ImageGallery 的设置
ftb.imagegallery.aspx文件里
JavaScriptLocation="InternalResource" UtilityImagesLocation="InternalResource"
SupportFolder="~/aspnet_client/FreeTextBox/"
AllowImageDelete=true
AllowImageUpload=true
AllowDirectoryCreate=false
AllowDirectoryDelete=false
runat="Server" />
AllowDirectoryCreate - 能否建立文件夹
AllowDirectoryDelete - 能否删除文件夹
AllowImageUpload - 能否上传图片
AllowImageDelete - 能否删除图片
AcceptedFileTypes - 可以上传文件扩展名的数组(array)
为开发者提供的2个属性
CurrentDirectories - a string[] array of directories to allow the user to navigate toward
CurrentImages - a FileInfo[] array of files the user should be able to insert.
建议: 删掉Page_Load事件可以显著回避上传图片不能即时显示的问题. 不要重写Page_Load
That's all. Thanks
Annerose
12/26/2005
=======================
By the way. My first post:
http://blog.hexun.com/annerose/1779631/viewarticle.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库