本文整理汇总了VB.NET中System.Web.HttpPostedFile.InputStream属性的典型用法代码示例。如果您正苦于以下问题:VB.NET HttpPostedFile.InputStream属性的具体用法?VB.NET HttpPostedFile.InputStream怎么用?VB.NET HttpPostedFile.InputStream使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了HttpPostedFile.InputStream属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MyFileCollection
' 导入命名空间
Imports System.Web
Imports System.Web.UI
Public Class Page1: Inherits Page
Protected Loop1 As Integer
Protected MyString As String
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim MyFileCollection As HttpFileCollection
Dim MyFile As HttpPostedFile
Dim FileLen As Integer
Dim MyString As String
Dim MyStream As System.IO.Stream
MyFileCollection = Request.Files
MyFile = MyFileCollection(0)
FileLen = MyFile.ContentLength
Dim Input(FileLen) As Byte
' Initialize the stream.
MyStream = MyFile.InputStream
' Read the file into the byte array.
MyStream.Read(input, 0, FileLen)
' Copy the byte array into a string.
For Loop1 = 0 To FileLen-1
MyString = MyString & Input(Loop1).ToString()
Next Loop1
End Sub
End Class