日期:2014-05-17  浏览次数:20491 次

图片管理系统-源码
我急需一个ASP.Net图片(相册)管理系统,要求就是,能批量上传的,可以对图片修改删除,希望各位大神们,帮帮忙,十万火急!

------解决方案--------------------
css:

.mflLeft
{
font-size:13px;
position:relative;
float:left;
clear:left;
margin:5px;
width:100px;
height:300px;
border:solid 1px silver;
text-align:center;
}
.mflRight
{
font-size:13px;
position:relative;
float:left;
width:300px;
height:300px;
margin:5px;
margin-left:0px;
border:solid 1px silver;
overflow:auto;
text-align:left;
}
.mflBottom
{
position:relative;
clear:both;
margin:0px 5px 0px 5px;
width:400px;
padding:4px;
text-align:left;
border:solid 1px silver;
}
/*******上传文件控件样式*******/
.mflFileUploadCss
{
width:70px;
height:30px;
margin:-2px 0px 0px -7px;
filter:alpha(opacity=0);
opacity:0; 
}
/******包含上传控件的Div******/
.mflLeft_FileUpload
{
position:relative;
margin-top:30px;
border:solid 1px silver;
width:71px;
height:28px;
overflow:hidden;
clear:both;
cursor:pointer;
background-image:url("../images/view.gif");
background-repeat:no-repeat;
background-position:left center;
}
/****保存上传文件信息的OL样式****/
.mflRightOlFiles
{
margin-top:20px;
}
.mflRightOlFiles li
{
padding:5px;
}
span
{
font-size:12px;
color:green;
}
.mflFileCountMsg
{
margin-left:10px;
}
.FileNameStyle
{
color:Silver;
}

</style>

js:

<script type="text/javascript">
//限制文件数
var mflFileMaxCount = 5;
var mflFileCount = 0;
//限制文件类型
var mflCouldUserTypes = "|.jpeg|.jpg|.gif|.png|";

function AddFile(obj) {
var fileName = obj.value;
if (mflFileCount >= mflFileMaxCount) {
window.alert("信息提示:系统设置,最多只能同时上传[" + mflFileMaxCount + "]个文件.");
return;
}

if ($.trim(fileName) == "") {
//用户没有选择文件
return;
}

var type = fileName.substring(fileName.lastIndexOf("."));
type = type.toLowerCase();
var sFileName = fileName.substring(fileName.lastIndexOf("\\"));
var newFileLoadTmp = "<input type='file' name='mflFileUpload" + (mflFileCount + 1) + "' id='mflFileUpload" + (mflFileCount + 1) + "' onchange='AddFile(this)' class='mflFileUploadCss' />"
var newLiFile = "<li><span class='FileNameStyle'>" + sFileName + "</span>&nbsp;<img src='../images/ac_02.jpg' onclick='mflRemoveFile(this)' /></li>";

if ($.trim(type) == "" || $.trim(sFileName) == "") {
//用户没有选择文件
return;
}
if (mflCouldUserTypes.indexOf("|" + type + "|") != -1) {
$(obj).css("display", "none");
$(".mflLeft_FileUpload").append(newFileLoadTmp);
$(".mflRightOlFiles").append(newLiFile);
mflFileCount += 1;
$(".mflFileCountMsg").html("已选文件数:" + mflFileCount);
}
else {
window.alert("信息提示:文件类型不正确。");
}
}

function mflRemoveFile(obj) {
if (confirm("信息提示:确定移除该文件?")) {
var innerHtml = $(obj).parent().html();
var itemIndex = 0;
for (itemIndex = 0; itemIndex < $(".mflRightOlF