本文整理匯總了VB.NET中System.Web.HttpRequest.MapPath方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET HttpRequest.MapPath方法的具體用法?VB.NET HttpRequest.MapPath怎麽用?VB.NET HttpRequest.MapPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了HttpRequest.MapPath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: New
' 導入命名空間
Imports System.IO
Imports System.Text
Namespace Samples.AspNet.VB.Controls
Public Class UpperCaseFilterStream
Inherits Stream
' This filter changes all characters passed through it to uppercase.
Private strSink As Stream
Private lngPosition As Long
Public Sub New(ByVal sink As Stream)
strSink = sink
End Sub
' The following members of Stream must be overriden.
Public Overrides ReadOnly Property CanRead() As Boolean
Get
Return True
End Get
End Property
Public Overrides ReadOnly Property CanSeek() As Boolean
Get
Return True
End Get
End Property
Public Overrides ReadOnly Property CanWrite() As Boolean
Get
Return True
End Get
End Property
Public Overrides ReadOnly Property Length() As Long
Get
Return 0
End Get
End Property
Public Overrides Property Position() As Long
Get
Return lngPosition
End Get
Set(ByVal value As Long)
lngPosition = Value
End Set
End Property
Public Overrides Function Seek( _
ByVal offset As Long, ByVal direction As System.IO.SeekOrigin) As Long
Return strSink.Seek(offset, direction)
End Function 'Seek
Public Overrides Sub SetLength(ByVal length As Long)
strSink.SetLength(length)
End Sub
Public Overrides Sub Close()
strSink.Close()
End Sub
Public Overrides Sub Flush()
strSink.Flush()
End Sub
Public Overrides Function Read( _
ByVal buffer() As Byte, ByVal offset As Integer, ByVal count As Integer) As Integer
Return strSink.Read(buffer, offset, count)
End Function 'Read
' The Write method actually does the filtering.
Public Overrides Sub Write( _
ByVal buffer() As Byte, ByVal offset As Integer, ByVal count As Integer)
Dim data(count) As Byte
System.Buffer.BlockCopy(buffer, offset, data, 0, count)
Dim inputstring As String = Encoding.ASCII.GetString(data).ToUpper()
data = Encoding.ASCII.GetBytes(InputString)
strSink.Write(data, 0, count)
End Sub
End Class
End Namespace