Application of ASP Camera programming technology

Source: Internet
Author: User

Code:

<%@ Language=vbscript codepage=65001%>
<%
Private Function DecodeBase64 (base64)
Dim DM, EL
Set DM = CreateObject ("Microsoft.XMLDOM")
Set EL = dm.createelement ("tmp")
EL. DataType = "Bin.base64"
EL. Text = Base64
DecodeBase64 = EL. nodeTypedValue
End Function


Dim data

Data=decodebase64 (Request. Form ("Pic_data"))


Set Stm=server.createobject ("ADODB. Stream ")
' STM. Mode=adsavecreateoverwrite ' adModeReadWrite
Stm.type=1
Stm.open
Stm. Write (data)
Stm. SaveToFile Server.MapPath ("./") & "/" & Request. Form ("desc") & ". jpg", 2
Stm. Close
Set stm=nothing

Response.Write "

Response.Write "desc:" & request. Form ("desc")
Response.End

%>

Gorgeous split line The following is the HTML page source code for the foreground operation camera photo

---------------------------------------------------------------------------------------------------

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title>video Cap Control demo</title>
<script type= "Text/javascript" src= "./js/jquery-1.4.2.min.js" ></script>
<script type= "Text/javascript" src= "Test1.js" ></script>
<body>

<form action= "test1.asp" id= "Cap_form" method= "POST" >
<input type= "hidden" id= "Picdata" name= "Picdata" >
<object classid= "Clsid:34681db3-58e6-4512-86f2-9477f1a9f3d8"
Id= "WebVideoCap1" codebase= "./cabs/package.cab#version=1,0,0,50" width= "636" height= "238" >
<param name= "Visible" value= "0" >
<param name= "AutoScroll" value= "0" >
<param name= "AutoSize" value= "0" >
<param name= "Axborderstyle" value= "1" >
<param name= "Caption" value= "Webvideocap" >
<param name= "Color" value= "4278190095" >
<param name= "Font" value= "Song Body" >
<param name= "KeyPreview" value= "0" >
<param name= "PixelsPerInch" value= ">"
<param name= "Printscale" value= "1" >
<param name= "scaled" value= "-1" >
<param name= "DropTarget" value= "0" >
<param name= "HelpFile" value>
<param name= "Popupmode" value= "0" >
<param name= "Screensnap" value= "0" >
<param name= "Snapbuffer" value= "ten" >
<param name= "Docksite" value= "0" >
<param name= "doublebuffered" value= "0" >
<param name= "parentdoublebuffered" value= "0" >
<param name= "Usedockmanager" value= "0" >
<param name= "Enabled" value= "-1" >
<param name= "alignwithmargins" value= "0" >
<param name= "Parentcustomhint" value= "-1" >
<param name= "Jpegbase64data" value>
<param name= "Bmpbase64data" value>
</object>

<input type= "hidden" name= "Pic_data" id= "Pic_data"/>
Photo Description: <input type= "text" name= "desc" id= "desc"/>

<input type= "button" value= "Camera" id= "Btn_cap"/>

<input type= "button" value= "Submit" id= "Btn_submit"/>

</form>
</body>

---------------------------------------------------------------------------------

Sample program Download Address: http://peihexian.javaeye.com/blog/710177

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.