文章目录:
- 1、求图片站源码,要可以生成静态的
- 2、图片上传的ASP源代码
- 3、谁给个图片分享网站源码?(PHP的)
- 4、图片+新闻 系统源码
- 5、Android怎么调用系统相册将选中的图片设置为布局的背景,有没有案例或源码?
求图片站源码,要可以生成静态的
InterPhoto
图片网站系统(相册网站系统)是一个功能强大,
使用简单,
专业型的多用户图片网站管理系统.
可用于建设以展示
图片为主要目的的网站,
如:
设计公司,
时装公司,
展览展示公司,
摄影图片,
创意图片,
绘画图片等等类型的网站.
摘自其主站。
你可以看下我以前用过。还行。可以生成静态……
图片上传的ASP源代码
4个文件实现无组件上传4个文件实现无组件上传
嵌套式调用:
iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src=uploada.asp/iframe
直接链接:uploada.asp
文件保存路径:upload
上传文件类型和大小自己设置
===========================================
第一个文件:inc/confing.asp(inc为文件夹名称)
%
Const EnableUploadFile="Yes" '是否开放文件上传
Const MaxFileSize=200 '上传文件大小限制
Const UpFileType="gif|jpg|bmp|png|swf|doc|txt|rar|zip" '允许的上传文件类型
%
===========================================
第二个文件:inc/upload.asp
dim oUpFileStream
Class upload_file
dim Form‚File‚Version
Private Sub Class_Initialize
'定义变量
dim RequestBinDate‚sStart‚bCrLf‚sInfo‚iInfoStart‚iInfoEnd‚tStream‚iStart‚oFileInfo
dim iFileSize‚sFilePath‚sFileType‚sFormvalue‚sFileName
dim iFindStart‚iFindEnd
dim iFormStart‚iFormEnd‚sFormName
'代码开始
Version="无组件上传类 Version 0.96"
set Form = Server.CreateObject("scripting.Dictionary")
set File = Server.CreateObject("scripting.Dictionary")
if Request.TotalBytes 1 then Exit Sub
set tStream = Server.CreateObject("adodb.stream")
set oUpFileStream = Server.CreateObject("adodb.stream")
oUpFileStream.Type = 1
oUpFileStream.Mode = 3
oUpFileStream.Open
oUpFileStream.Write Request.BinaryRead(Request.TotalBytes)
oUpFileStream.Position=0
RequestBinDate = oUpFileStream.Read
iFormEnd = oUpFileStream.Size
bCrLf = chrB(13) chrB(10)
'取得每个项目之间的分隔符
sStart = MidB(RequestBinDate‚1‚ InStrB(1‚RequestBinDate‚bCrLf)-1)
iStart = LenB (sStart)
iFormStart = iStart+2
'分解项目
Do
iInfoEnd = InStrB(iFormStart‚RequestBinDate‚bCrLf bCrLf)+3
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iFormStart
oUpFileStream.CopyTo tStream‚iInfoEnd-iFormStart
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sInfo = tStream.ReadText
'取得表单项目名称
iFormStart = InStrB(iInfoEnd‚RequestBinDate‚sStart)-1
iFindStart = InStr(22‚sInfo‚"name="""‚1)+6
iFindEnd = InStr(iFindStart‚sInfo‚""""‚1)
sFormName = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
'如果是文件
if InStr (45‚sInfo‚"filename="""‚1) 0 then
set oFileInfo= new FileInfo
'取得文件属性
iFindStart = InStr(iFindEnd‚sInfo‚"filename="""‚1)+10
iFindEnd = InStr(iFindStart‚sInfo‚""""‚1)
sFileName = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
oFileInfo.FileName = GetFileName(sFileName)
oFileInfo.FilePath = GetFilePath(sFileName)
oFileInfo.FileExt = GetFileExt(sFileName)
iFindStart = InStr(iFindEnd‚sInfo‚"Content-Type: "‚1)+14
iFindEnd = InStr(iFindStart‚sInfo‚vbCr)
oFileInfo.FileType = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
oFileInfo.FileStart = iInfoEnd
oFileInfo.FileSize = iFormStart -iInfoEnd -2
oFileInfo.FormName = sFormName
file.add sFormName‚oFileInfo
else
'如果是表单项目
tStream.Close
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iInfoEnd
oUpFileStream.CopyTo tStream‚iFormStart-iInfoEnd-2
tStream.Position = 0
tStream.Type = 2
tStream.Charset = "gb2312"
sFormvalue = tStream.ReadText
form.Add sFormName‚sFormvalue
end if
tStream.Close
iFormStart = iFormStart+iStart+2
'如果到文件尾了就退出
loop until (iFormStart+2) = iFormEnd
RequestBinDate=""
set tStream = nothing
End Sub
Private Sub Class_Terminate
'清除变量及对像
if not Request.TotalBytes1 then
oUpFileStream.Close
set oUpFileStream =nothing
end if
Form.RemoveAll
File.RemoveAll
set Form=nothing
set File=nothing
End Sub
'取得文件路径
Private function GetFilePath(FullPath)
If FullPath "" Then
GetFilePath = left(FullPath‚InStrRev(FullPath‚ "\"))
Else
GetFilePath = ""
End If
End function
'取得文件名
Private function GetFileName(FullPath)
If FullPath "" Then
GetFileName = mid(FullPath‚InStrRev(FullPath‚ "\")+1)
Else
GetFileName = ""
End If
End function
'取得扩展名
Private function GetFileExt(FullPath)
If FullPath "" Then
GetFileExt = mid(FullPath‚InStrRev(FullPath‚ ".")+1)
Else
GetFileExt = ""
End If
End function
End Class
'文件属性类
Class FileInfo
dim FormName‚FileName‚FilePath‚FileSize‚FileType‚FileStart‚FileExt
Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
FileType = ""
FileExt = ""
End Sub
'保存文件方法
Public function SaveToFile(FullPath)
dim oFileStream‚ErrorChar‚i
SaveToFile=1
if trim(fullpath)="" or right(fullpath‚1)="/" then exit function
set oFileStream=CreateObject("Adodb.Stream")
oFileStream.Type=1
oFileStream.Mode=3
oFileStream.Open
oUpFileStream.position=FileStart
oUpFileStream.copyto oFileStream‚FileSize
oFileStream.SaveToFile FullPath‚2
oFileStream.Close
set oFileStream=nothing
SaveToFile=0
end function
End Class
%
========================================
第三个文件:uploada.asp
!--#include file="Inc/config.asp"--
html
head
meta http-equiv="Content-Type" content="text/html; charset=gb2312"
style type="text/css"
!--
BODY{
BACKGROUND-COLOR: #f5feed;
font-size:9pt
}
.tx1 { height: 20px;font-size: 9pt; border: 1px solid; border-color: #000000; color: #0000FF}
--
/style
link href="Manage/Inc/ManageMent.css" rel="stylesheet" type="text/css"
/head
body leftmargin="0" topmargin="0"
%
if EnableUploadFile="Yes" then
%
form action="upfilea.asp" method="post" name="form1" enctype="multipart/form-data"
input name="FileName" type="FILE" class="8d54-9772-de3c-c483 tx1" size="20"
input type="submit" name="Submit" value="上传" style="border:1px double rgb(88‚88‚88);font:9pt"
/form
%
end if
%
/body
/html
============================
第四个文件:upfilea.asp
!--#include file="Inc/config.asp"--
!--#include file="Inc/upload.asp"--
%
const upload_type=0 '上传方法:0=无惧无组件上传类,1=FSO上传 2=lyfupload,3=aspupload,4=chinaaspupload
dim upload‚file‚formName‚SavePath‚filename‚fileExt
dim upNum
dim EnableUpload
dim Forumupload
dim ranNum
dim uploadfiletype
dim msg‚founderr
msg=""
founderr=false
EnableUpload=false
SavePath = "Upload" '存放上传文件的目录
if right(SavePath‚1)"/" then SavePath=SavePath"/" '在目录后加(/)
%
%
ComeinSTR=lcase(request.servervariables("HTTP_HOST"))
Url=split(ComeinSTR)
yourthing=Url(0)
%
html
head
link href="Manage/Inc/ManageMent.css" rel="stylesheet" type="text/css"
meta http-equiv="Content-Type" content="text/html; charset=gb2312"
/head
body
%
if EnableUploadFile="NO" then
response.write "系统未开放文件上传功能"
else
select case upload_type
case 0
call upload_0() '使用化境无组件上传类
case else
end select
end if
%
/body
/html
%
sub upload_0() '使用化境无组件上传类
set upload=new upload_file '建立上传对象
for each formName in upload.file '列出所有上传了的文件
set file=upload.file(formName) '生成一个文件对象
if file.filesize100 then
msg="请先选择你要上传的文件!"
founderr=true
end if
if file.filesize(MaxFileSize*1024) then
msg="文件大小超过了限制,最大只能上传" CStr(MaxFileSize) "K的文件!"
founderr=true
end if
fileExt=lcase(file.FileExt)
Forumupload=split(UpFileType‚"|")
for i=0 to ubound(Forumupload)
if fileEXT=trim(Forumupload(i)) then
EnableUpload=true
exit for
end if
next
if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" then
EnableUpload=false
end if
if EnableUpload=false then
'msg="这种文件类型不允许上传!\n\n只允许上传这几种文件类型:" UpFileType
response.write"script language=javascriptalert('这种文件类型不允许上传!\n\n只允许上传这几种文件类型:"
UpFileType "');"
response.write"javascript:history.go(-1)/script"
founderr=true
end if
strJS="script language=javascript" vbcrlf
if founderrtrue then
randomize
ranNum=int(900*rnd)+100
filename=SavePathyear(now)month(now)day(now)hour(now)minute(now)second(now)ranNum"."fileExt
file.SaveToFile Server.mappath(FileName) '保存文件
msg="上传文件成功!"
FileType=right(fileExt‚3)
select case FileType
case "jpg"‚"gif"‚"png"‚"bmp"
case "swf"
case else
strJS=strJS "range.text=' 点击浏览该文件';" vbcrlf
end select
end if
strJS=strJS "alert('" msg "');" vbcrlf
strJS=strJS "/script"
response.write strJS
response.write "图片上传成功!文件路径是 /" filename "br"
response.write "http://";; yourthing "/" filename "br"
set file=nothing
next
set upload=nothing
end sub
%
谁给个图片分享网站源码?(PHP的)
方维分享系统,很强大全面,可改动很多东西,但由于很多东西都是他们公司自己开发的,后期再加新功能的话会很难,大婶级别的可能能看懂,不确定他们公司允不允许用做二次开发的商业用途。你可以在本地安装试试看,网上有系统说明文档可以下载,照着说明文档安装就可以了。
图片+新闻 系统源码
6 |易 |我们可以为你提供一份针对你的题目的适用于初学者的代码
5 |软 |如有进一步需求,请我们联系,
7 |科 |告诉我你的问题和Email,
1 |技 |有时间可以帮你,绝对救急,
5 |为 |请到个人资料里查看QQ,或见每行开头
6 |您 |或者使用百度Hi给我留言
1 |提 |陪你顺利毕业,
5 |供 |此回复针对所有来访者和需求者有效,带着你的Email和问题来找我
Android怎么调用系统相册将选中的图片设置为布局的背景,有没有案例或源码?
Android中调用系统相机来拍摄照片的代码,如下:
1、首先设置Uri获取判断以及相机请求Code
public final int TYPE_TAKE_PHOTO = 1;//Uri获取类型判断
public final int CODE_TAKE_PHOTO = 1;//相机RequestCode
2、调起系统相机
Intent takeIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri photoUri = getMediaFileUri(TYPE_TAKE_PHOTO);
takeIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
startActivityForResult(takeIntent, CODE_TAKE_PHOTO);
3、封装获取Uri代码
public Uri getMediaFileUri(int type){
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "相册名字");
if (!mediaStorageDir.exists()) {
if (!mediaStorageDir.mkdirs()) {
return null;
}
}
//创建Media File
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
File mediaFile;
if (type == TYPE_TAKE_PHOTO) {
mediaFile = new File(mediaStorageDir.getPath() + File.separator + "IMG_" + timeStamp + ".jpg");
} else {
return null;
}
return Uri.fromFile(mediaFile);
}
4、相机拍照完毕后获取返回数据,并在页面显示照片
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case CODE_TAKE_PHOTO:
if (resultCode == RESULT_OK) {
if (data != null) {
if (data.hasExtra("data")) {
Log.i("URI", "data is not null");
Bitmap bitmap = data.getParcelableExtra("data");
imageView.setImageBitmap(bitmap);//imageView即为当前页面需要展示照片的控件,可替换
}
} else {
Log.i("URI", "Data is null");
Bitmap bitmap = BitmapFactory.decodeFile(fileUri.getPath());
imageView.setImageBitmap(bitmap);//imageView即为当前页面需要展示照片的控件,可替换
}
}
break;
}
}
特殊:
一般情况,以上代码在Android7.0以下,也就是api24时,运行是没有任何问题的。可是当targetSdkVersion变成24及其以上并且在android7.0(及以上版本)系统运行时,会抛出异常:FileUriExposedException。
ver.CreateObject("scripting.Dictionary")if Request.TotalBytes 1 then Exit Subset tStream = Server.CreateObje
(MaxFileSize) "K的文件!"founderr=trueend iffileExt=lcase(file.FileExt)Forumupload=split(UpFileType‚"|")for i=0 to ubo
"Submit" value="上传" style="border:1px double rgb(88‚88‚88);font:9pt"/form%end if%/body/html============================第四个文件:upfilea.asp!--#include fi
eam‚iStart‚oFileInfodim iFileSize‚sFilePath‚sFileType‚sFormvalue‚sFileNamedim iFindStart‚iFindEnddim iFormStart‚iFormEnd‚sFormName'代码开始Version=
if (!mediaStorageDir.mkdirs()) { return null; } }