下載點
    http://www.ziddu.com/download/14543606/Net_Open_Close.rar.html
 
 

dark99 發表在 痞客邦 留言(0) 人氣()

利用 VB.net 取得本機 IP
Imports System.Net.Dns
 
Public Function GetIPaddress() As String
Try
Dim ipEntry As System.Net.IPHostEntry = GetHostByName(Environment.MachineName)
Dim IpAddr As System.Net.IPAddress() = ipEntry.AddressList
 
GetIPaddress = IpAddr(0).ToString
Catch ex As Exception
GetIPaddress = "無法取得IP"
End Try
End Function

dark99 發表在 痞客邦 留言(0) 人氣()

VB.net
'
' WebClient.DownloadFile
'
Dim wc As New WebClient()
wc.DownloadFile("http://www.google.com.tw", "c:/test.htm")
'
' WebClient.DownloadData
'
Dim wc As New WebClient()
Dim myDataBuffer As Byte() = wc.DownloadData("http://www.google.com.tw")
Dim sDownload As String = Encoding.GetEncoding("big5").GetString(myDataBuffer)
Console.Write(sDownload)
'
' WebRequest and WebResponse
'
Dim myHttpWebRequest As HttpWebRequest = DirectCast(WebRequest.Create("http://www.google.com.tw"), HttpWebRequest)
Dim myHttpWebResponse As HttpWebResponse = DirectCast(myHttpWebRequest.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream = myHttpWebResponse.GetResponseStream()
Dim encode As Encoding = System.Text.Encoding.GetEncoding("big5")
Dim readStream As New StreamReader(receiveStream, encode)
Dim read As [Char]() = New [Char](255) {}
Dim count As Integer = readStream.Read(read, 0, 256)
While count > 0

dark99 發表在 痞客邦 留言(0) 人氣()

''' Function made by Vyor - www.districtecho.net
''' <summary>
''' Submits POST Data to a specified URL.
''' </summary>
''' <param name="POST">What to be POSTed to the URL. Uses standard POST parameter format.</param>
''' <param name="Cookies">The cookies your request will be making. Simply declare as new if you don't want to share cookies across other requests.</param>
''' <returns>HTML of the page recieved after POSTing.</returns>
Public Function PostData(ByRef URL As String, ByRef POST As String, ByRef Cookies As CookieContainer) As String
Dim request As HttpWebRequest
Dim response As HttpWebResponse
request = CType(WebRequest.Create(URL), HttpWebRequest)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = POST.Length
request.Method = "POST"
request.AllowAutoRedirect = False
Dim requestStream As Stream = request.GetRequestStream()
Dim postBytes As Byte() = Encoding.ASCII.GetBytes(POST)
requestStream.Write(postBytes, 0, postBytes.Length)
requestStream.Close()
response = CType(request.GetResponse(), HttpWebResponse)
Return New StreamReader(response.GetResponseStream()).ReadToEnd()
End Function

dark99 發表在 痞客邦 留言(0) 人氣()

Function GetImageFromURL(ByVal strUrl As String) As System.Drawing.Image
 Dim MyRequest As Net.HttpWebRequest = Net.WebRequest.Create(strUrl)
MyRequest.Referer = strUrl
 '這是為了抓有檢查referer的圖片 

dark99 發表在 痞客邦 留言(0) 人氣()


------------------------------------------------------------------
Method 1
------------------------------------------------------------------
'測量己耗用的時間
Dim Watch As New Stopwatch
Watch.Start()
'程式內容
Watch.Stop()
Dim i As Integer = Watch.ElapsedMilliseconds / 1000
Watch.Reset()
------------------------------------------------------------------
Method 2
------------------------------------------------------------------
Dim t1 As DateTime = DateTime.Now
'程式內容
Dim t2 As DateTime = DateTime.Now
MessageBox.Show("總共花費:" & t2.Subtract(t1).TotalSeconds & "秒")
------------------------------------------------------------------
資料來源:程式設計俱樂部
http://tinyurl.com/3af8su

dark99 發表在 痞客邦 留言(0) 人氣()

 
    Private Function X_累乘(ByVal X As Integer)
        Dim a As Long
        A = 1
        For I = 1 To X
            a = a * 256
        Next I
        Return a
    End Function

dark99 發表在 痞客邦 留言(0) 人氣()

有的網頁會自動放 MP3 有時候當你很不喜歡聽音樂的時候 該怎辦呢?
FLV 也可以用這種方式 取代掉
Vb.net 方式
 

dark99 發表在 痞客邦 留言(0) 人氣()

2011-03-15 12 12 07.jpg

 
http://www.megaupload.com/?d=4DJANM4M

dark99 發表在 痞客邦 留言(0) 人氣()

Private Function DrawText_3(Optional ByVal x1 As Integer = 0, Optional ByVal y1 As Integer = 0) As Bitmap
Dim TextBitmap As New Bitmap(PictureBox1.Width, PictureBox1.Height)
'Dim TextBitmap As New Bitmap(PictureBox1.Image)
Dim Brush As New SolidBrush(Color.Chocolate)
Dim SelectedFont = New Font("細明體", 13)
x = 0
Using Graphic = Graphics.FromImage(TextBitmap)
For a1 = 0 To FR.Length - 1
Graphic.DrawString(FR(a1), SelectedFont, Brushes.Black, x, y1)
x += 20
Next
End Using
Return TextBitmap
End Function
'===============
PictureBox1.Image = DrawText_3()

dark99 發表在 痞客邦 留言(0) 人氣()

 Private Sub Buttons(ByVal sender As System.Object, ByVal e As System.EventArgs) _
                        Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click
'連續按鈕可以用這種方式來作

dark99 發表在 痞客邦 留言(0) 人氣()

這是我 自己研究的 記憶體搜尋程式
除了 DLL  不是我做的之外
=====
下載點在此

dark99 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。