怎么题目和里面的内容不一样啊,如果仅仅是将二进制转换成普通的字符串,那么这样就可以了:
dim ss as string
dim dd() as byte
dim bb() as byte
'然后dd里面读入十六进制数据
'那么
ss=strConv(dd,Unicode)
那么ss就是有dd转换成的特殊的字符串了
如果要转换回去
那么
bb=strConv(ss,vbFormUnicode)
这样bb就是和dd一模一样的二进制数据了
Dim strServerURL 'Local Web Server Name including http:// protocol
Dim strTargetURL 'Directory where we will upload our file to
Dim strRepostURL 'Path to the page we will display after our file uploads
Dim strPathToPA 'Path to the cpshost.dll
Dim strPostingURL 'Action path for our form
If Request.ServerVariables("LOGON_USER") = "" Then
Response.Status = "401 Access Denied"
Response.End
End If
In the next section we use ASP Server Variables to retrieve the name of our Web server, which will make this code portable.
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
The final step is to display our form. We set the enctype of the form to multipart/form-data and dynamically populate the values for the action tag and target URL.
<form enctype="multipart/form-data" action="<% = strPostingURL %>" method="POST">
<input type="hidden" name="TargetURL" value="<% = strTargetURL %>">
<center><table>
<tr>
<td align="left">Supply the local path to the previously scanned image file in *.gif, *.jpeg format:</td>
</tr>
<tr>
<td align="left"><input name="my_file" type="file" size="20"></td>
</tr>
<tr>
<td align="right"><input type="Submit" value="Next >>"></td>
</tr>
<table></center>
</form>
</BODY>
</HTML>
When this page is loaded the user will be able to browse their local file system to find the photograph that they need to upload. When they click on the Next button, the form will be posted to the CPSHOST.DLL for upload processing. Once that has completed successfully, our AddEmployeeFinish.asp page will be displayed in the user's browser. As you can see, there really isn't much to this.
We will create a new ASP page called called AddEmployeeFinish.ASP. This will be our confirmation page, and it will display after the file has been uploaded. In this first section we once again force authentication on the page and define our variables. Copy the following code to your ASP file:
Option Explicit
Dim strFilename 'File uploaded to web server
Dim strPath 'Path up file uploaded to web server
Dim I 'Counter
If Request.ServerVariables("LOGON_USER") = "" Then
Response.Status = "401 Access Denied"
Response.End
End If
Working with a multipart form is a little different than working with a standard form. We need to iterate through the form collection to retrieve the filename, file extension, and physical path. We do this in the following section of code, assigning these values to our variables.
For I = 1 To Request.Form("FileName").Count
strFilename = Request.Form("FileName")(I) & Request.Form("FileExtention")(I)
strPath = Request.Form("FilePath")(I)
Next
%>
Finally, we display a confirmation message to the user: