本文整理汇总了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
开发者ID:VB.NET开发者,项目名称:System.Web,代码行数:95,代码来源:HttpRequest.MapPath
注:本文中的System.Web.HttpRequest.MapPath方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论