
'利用Encoding.Unicode.GetBytes()
Imports System.Text
Module Module1
Sub Main()
Console.Write("輸入字串 > ")
colud77 發表在 痞客邦 留言(0) 人氣(2,106)

IE瀏覽器(Internet Explorer)
IE或控制台->Internet選項->安全->受限制的網站->網站
添加受限制的網站:box.anchorfree.net
colud77 發表在 痞客邦 留言(0) 人氣(8)

'利用{0:X}來呈現16進位
Console.WriteLine("i={0} 16進位=&H{0:X4}" ,i ,i)
'顯示如下
i=15 16進位=&H000F
colud77 發表在 痞客邦 留言(0) 人氣(966)

'要將數值轉換成字串,有二種方法。一種是用資料類型的ToString()來做,另一種則是以Convert類別的ToString()來做。
Module Module1
Sub Main()
Dim i As Integer = 789
'將整數轉換字串
colud77 發表在 痞客邦 留言(0) 人氣(11,515)

'利用VB.net內建函數取得可用磁碟清單'GetDrivesImports System.IOModule Module1 Sub Main() Dim drives() as string = Directory.GetLogicalDrives() Console.WriteLine("可以使用的磁碟機") For Each s As String In drives Console.WriteLine(s)
colud77 發表在 痞客邦 留言(0) 人氣(721)

Module TestSalesObject
Public Sub Main()
'定義區域變數 透過屬性初始化物件
Dim sales As New Sales() With {.Id = "777", .Name = "Cloud", .BirthDate = New DateTime(2000, 1, 1), .Sex = "男性", .Qa = 50000}
sales.Salary = 20000
colud77 發表在 痞客邦 留言(0) 人氣(737)

'定義委派
Public Delegate Sub sayHello(ByVal thing As String)
Public Class HelloWorld
Private _msg As String
'事件
Public Event MyEvent As sayHello
'屬性
Public Property Msg() As String
Get
Return _msg
End Get
Set(ByVal value As String)
_msg = value
End Set
End Property
colud77 發表在 痞客邦 留言(1) 人氣(982)
委派(Delegate)定義 Method 結構
'定義委派
Public Delegate Sub Hello(ByVal str As String)
'主程式
Module TestHello
Public Sub Main()
'建構委派
Dim SH As New Hello(AddressOf HelloWorld)
'呼喚-同步
SH.Invoke("Cloud")
End Sub
'給委派用的程序
Private Sub HelloWorld(ByVal s As String)
System.Console.WriteLine(s & " Hello World!!")
End Sub
End Module
colud77 發表在 痞客邦 留言(0) 人氣(1,882)

Public Class Form1
Private Declare Function SetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 300
colud77 發表在 痞客邦 留言(0) 人氣(550)

Me.StartPosition = FormStartPosition.Manual
'固定位置的左上角坐標
Me.Location = New Point(0, 0)
另外可以將FormBorderStyle屬性設為None隠藏標題列
colud77 發表在 痞客邦 留言(0) 人氣(1,052)