本文整理匯總了VB.NET中System.Uri.UserInfo屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET Uri.UserInfo屬性的具體用法?VB.NET Uri.UserInfo怎麽用?VB.NET Uri.UserInfo使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Uri
的用法示例。
在下文中一共展示了Uri.UserInfo屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Uri
Dim uriAddress As New Uri("http://user:password@www.contoso.com/index.htm ")
Console.WriteLine(uriAddress.UserInfo)
Console.WriteLine("Fully Escaped {0}", IIf(uriAddress.UserEscaped, "yes", "no")) 'TODO: For performance reasons this should be changed to nested IF statements
示例2: Tester
' 導入命名空間
Imports System.Net
Imports System.Net.Sockets
Public Class Tester
Public Shared Sub Main
Dim URL As System.Uri
URL = New System.Uri("http://www.java2s.com/index.htm?key=value")
Console.WriteLine("AbsolutePath: " & URL.AbsolutePath)
Console.WriteLine("AbsoluteUri: " & URL.AbsoluteUri)
Console.WriteLine("Authority: " & URL.Authority)
Console.WriteLine("Host: " & URL.Host)
Console.WriteLine("Port: " & URL.Port)
Console.WriteLine("LocalPath: " & URL.LocalPath)
Console.WriteLine("IsDefaultPort: " & URL.IsDefaultPort)
Console.WriteLine("IsFile: " & URL.IsFile)
Console.WriteLine("PathAndQuery: " & URL.PathAndQuery)
Console.WriteLine("Query: " & URL.Query)
Console.WriteLine("Scheme: " & URL.Scheme)
Console.WriteLine("UserEscaped: " & URL.UserEscaped)
Console.WriteLine("UserInfo: " & URL.UserInfo)
End Sub
End Class