ftb.imagegallery.aspx
来自「天龙企业网站管理系统」· ASPX 代码 · 共 59 行
ASPX
59 行
<%@ Page Language="C#" ValidateRequest=false Trace="false" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<script runat="server">
protected void Page_Load(Object Src, EventArgs E) {
// *** remove this return statement to use the following code ***
return;
string currentFolder = ImageGallery1.CurrentImagesFolder;
// modify the directories allowed
if (currentFolder == "~/UploadFile") {
// these are the default directories FTB:ImageGallery will find
string[] defaultDirectories = System.IO.Directory.GetDirectories(Server.MapPath(currentFolder),"*");
// user defined custom directories
string[] customDirectories = new string[] {"folder1","folder2"};
// the gallery will use these images in this instance
ImageGallery1.CurrentDirectories = customDirectories;
}
// modify the images allowed
if (currentFolder == "~/UploadFile") {
System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(Server.MapPath(currentFolder));
// these are the default images FTB:ImageGallery will find
System.IO.FileInfo[] defaultImages = directoryInfo.GetFiles("*");
// user defined custom images (here, we're just allowing the first two)
System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] {defaultImages[0], defaultImages[1]};
// the gallery will use these images in this instance
ImageGallery1.CurrentImages = customImages;
}
this.ImageGallery1.AcceptedFileTypes = new String[] { "jpg", "jpeg", "jpe", "gif", "png", "rar" };
}
</script>
<html>
<head>
<title>Image Gallery</title>
</head>
<body>
<form id="Form1" runat="server" enctype="multipart/form-data">
<FTB:ImageGallery id="ImageGallery1"
AllowImageDelete="true" AllowImageUpload="true" AllowDirectoryCreate="false" AllowDirectoryDelete="false" runat="Server" />
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?