DllImport("kernel32.dll",?SetLastError:=True)?_

成都創(chuàng)新互聯(lián)主營(yíng)清水河網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,app軟件開(kāi)發(fā)公司,清水河h5微信小程序搭建,清水河網(wǎng)站營(yíng)銷推廣歡迎清水河等地區(qū)企業(yè)咨詢
Public?Shared?Function?ReadProcessMemory(ByVal?hProcess?As?IntPtr,?_
ByVal?lpBaseAddress?As?IntPtr,?_
Out()?ByVal?lpBuffer()?As?Byte,?_
ByVal?dwSize?As?Integer,?_
ByRef?lpBytesRead?As?Integer)?As?Boolean
End?Function
Dim?buffer(3)?As?Byte()
ReadProcessMemory(hProcess,?H274A024,?buffer,?buffer.Length,?bytesRead)
如果要讀不到,用逐步調(diào)試看看hProcess有沒(méi)有問(wèn)題,還要檢查H274A024是否存在。
Dim sFileName As String
Dim Search
Private Sub dateTimeMenu_Click()
Text1.Text = Now
End Sub
Private Sub deleteMenu_Click()
Text1.Text = Left(Text1.Text, Text1.SelStart) + Mid(Text1.Text, Text1.SelStart + Text1.SelLength + 1)
End Sub
Private Sub findMenu_Click()
Search = InputBox("請(qǐng)輸入要查找的字詞:")
Dim Where1 '獲取需要查找的字符串變量
Text1.SetFocus '文本框獲得焦點(diǎn),以顯示所找到的內(nèi)容Search = InputBox("請(qǐng)輸入要查找的字詞:")
Where1 = InStr(Text1.Text, Search) '在文本中查找字符串
If Where1 Then
'若找到則設(shè)置選定的起始位置并使找到的字符串高亮
Text1.SelStart = Where1 - 1
Text1.SelLength = Len(Search)
' Me.Caption = Where1 '測(cè)試用
'否則給出提示
Else: MsgBox "未找到所要查找的字符串。", vbInformation, "提示"
End If
End Sub
Private Sub findNextMenu_Click()
Dim Where2
Dim StartMe As Integer '查找的起始位置變量
Text1.SetFocus '文本框獲得焦點(diǎn)
StartMe = Text1.SelLength + Text1.SelStart + 1 '給變量賦值
Where2 = InStr(StartMe, Text1.Text, Search) '令其從上次找到的地方找起
If Where2 Then
Text1.SelStart = Where2 - 1
Text1.SelLength = Len(Search)
Else: MsgBox "未找到所要查找的字符串.", vbInformation, "提示"
End If
End Sub
Private Sub aboutMenu_Click()
MsgBox Space(2) "文本編輯器版本號(hào)1.0" Chr(13) "由西南財(cái)經(jīng)大學(xué)天府學(xué)院" Chr(13) Space(5) "肖忠 開(kāi)發(fā)" Chr(13) Space(2) "copyright:天府學(xué)院"
End Sub
Private Sub allMenu_Click()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub backcolorMenu_Click() '設(shè)置背景色代碼
Form1.CommonDialog1.Action = 3
Text1.BackColor = Form1.CommonDialog1.Color
End Sub
Private Sub colorMenu_Click() '改變文字顏色代碼
Form1.CommonDialog1.Action = 3
Text1.ForeColor = Form1.CommonDialog1.Color
End Sub
Private Sub cutMenu_Click()
Clipboard.SetText Text1.SelText
Text1.Text = Left(Text1.Text, Text1.SelStart) + Mid(Text1.Text, Text1.SelStart + Text1.SelLength + 1)
End Sub
Private Sub exitMenu_Click()
End
End Sub
Private Sub fontMenu_Click() '字體菜單代碼
Form1.CommonDialog1.Flags = 3 Or 256
Form1.CommonDialog1.Action = 4
If Len(Form1.CommonDialog1.FontName) = 0 Then
Form1.Text1.FontName = "宋體"
Else
Form1.Text1.FontName = Form1.CommonDialog1.FontName
End If
Form1.Text1.FontSize = Form1.CommonDialog1.FontSize
If Form1.CommonDialog1.FontBold = True Then
Form1.Text1.FontBold = True
Else
Form1.Text1.FontBold = False
End If
If Form1.CommonDialog1.FontItalic = True Then
Form1.Text1.FontItalic = True
Else
Form1.Text1.FontItalic = False
End If
Text1.ForeColor = Form1.CommonDialog1.Color
End Sub
Private Sub Form_Load()
Form1.Text1.Width = Form1.Width - 130
Form1.Text1.Height = Form1.Height
End Sub
Private Sub Form_Resize()
Form1.Text1.Width = Form1.Width - 130
Form1.Text1.Height = Form1.Height
End Sub
Private Sub help1Menu_Click()
Form1.CommonDialog1.HelpCommand = cdlHelpForceFile
Form1.CommonDialog1.HelpFile = "c:\windows\system32\winhelp.hlp"
CommonDialog1.ShowHelp
End Sub
Private Sub newMenu_Click()
If Len(Trim(Text1.Text)) = 0 Then
Form1.Caption = "我的記事本" "--" "未命名"
sFileName = "未命名"
Text1.FontSize = 15
Text1.FontName = "宋體"
Text1.Text = ""
Else
Call saveAsMenu_Click
Form1.Caption = "我的記事本" "--" "未命名"
sFileName = "未命名"
Text1.FontSize = 15
Text1.FontName = "宋體"
Text1.Text = ""
End If
End Sub
Private Sub openMenu_Click() '打開(kāi)文件代碼
If Len(Trim(Text1.Text)) = 0 Then
Form1.Caption = "我的記事本"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 4096
Form1.CommonDialog1.Action = 1
If Len(Form1.CommonDialog1.FileName) 0 Then
sFileName = Form1.CommonDialog1.FileName
Form1.Caption = Form1.Caption "--" Form1.CommonDialog1.FileTitle
Open sFileName For Input As #1
Text1.FontSize = 15
Text1.FontName = "宋體"
Do While Not EOF(1)
Line Input #1, Text$
All$ = All$ + Text$ + Chr(13) + Chr(10)
Loop
Text1.Text = All
Close #1
End If
Else
Call saveAsMenu_Click
Form1.Caption = "我的記事本"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 4096
Form1.CommonDialog1.Action = 1
If Len(Form1.CommonDialog1.FileName) 0 Then
sFileName = Form1.CommonDialog1.FileName
Form1.Caption = Form1.Caption "--" Form1.CommonDialog1.FileTitle
Open sFileName For Input As #1
Text1.FontSize = 15
Text1.FontName = "宋體"
Do While Not EOF(1)
Line Input #1, Text$
All$ = All$ + Text$ + Chr(13) + Chr(10)
Loop
Text1.Text = All
Close #1
End If
End If
End Sub
Private Sub pasteMenu_Click() '粘貼菜單代碼
Text1.Text = Left(Text1.Text, Text1.SelStart) + Clipboard.GetText() + Mid(Text1.Text, Text1.SelStart + Text1.SelLength + 1)
End Sub
Private Sub printMenu_Click()
Form1.CommonDialog1.ShowPrinter
For i = 1 To CommonDialog1.Copies
Printer.Print Text1.Text
Printer.Print Text1.Text
Next
Printer.EndDoc
End Sub
Private Sub saveAsMenu_Click() '另存為菜單代碼
If Len(Trim(Text1.Text)) 0 Then
Form1.CommonDialog1.DialogTitle = "保存文件"
Form1.CommonDialog1.InitDir = "D:\"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 2
Form1.CommonDialog1.ShowSave
If Len(Form1.CommonDialog1.FileName) 0 Then
sFileName = Form1.CommonDialog1.FileName
Open sFileName For Output As #1
whole$ = Text1.Text
Print #1, whole
Close #1
End If
End If
End Sub
Private Sub saveMenu_Click()
If Len(Trim(Text1.Text)) 0 Then
Form1.CommonDialog1.DialogTitle = "保存文件"
Form1.CommonDialog1.InitDir = "D:\"
Form1.CommonDialog1.FileName = "新建文本"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 2
Form1.CommonDialog1.ShowSave
If Len(Form1.CommonDialog1.FileName) 0 Then
sFileName = Form1.CommonDialog1.FileName
Open sFileName For Output As #1
whole$ = Text1.Text
Print #1, whole
Close #1
End If
End If
End Sub
Private Sub statusMenu_Click()
End Sub
vb.net是完全面向?qū)ο蟮恼Z(yǔ)言,支持面向?qū)ο蟮乃膫€(gè)基本屬性:抽象,繼承,多態(tài),封裝,但vb是面向過(guò)程的語(yǔ)言,它只支持部分面向?qū)ο蟮膬?nèi)容像多態(tài),接口等。從 VB 7.0 之后的版本俗稱 VB.NET,來(lái)源于微軟的.NET戰(zhàn)略,到現(xiàn)在為止有三個(gè)版本
VB 7.0 即VB 2002,對(duì)應(yīng).NET Framework 1.0的版本
VB 7.1 即VB 2003,對(duì)應(yīng).NET Framework 1.1的版本
VB 8.0 即VB 2005,對(duì)應(yīng).NET Framework 2.0的版本
除了語(yǔ)法和使用習(xí)慣的繼承,VB 6.0之前的版本和VB 7.0之后的版本完全沒(méi)有聯(lián)系,幾乎沒(méi)有相同之處,兩種不同體系的語(yǔ)言
VS2010中的VB就是VB.NET。
安裝了VS可從軟件的幫助入口獲取來(lái)自微軟MSDN的豐富在線幫助文檔。它就是具有相關(guān)教程內(nèi)容的網(wǎng)絡(luò)資源。
Microsoft Visual Studio 2010,Visual Studio是微軟公司推出的開(kāi)發(fā)環(huán)境,是目前最流行的Windows平臺(tái)應(yīng)用程序開(kāi)發(fā)環(huán)境。Visual Studio 2010版本于2010年4月12日上市,其集成開(kāi)發(fā)環(huán)境(IDE)的界面被重新設(shè)計(jì)和組織,變得更加簡(jiǎn)單明了。Visual Studio 2010同時(shí)帶來(lái)了NET Framework?4.0、Microsoft Visual Studio 2010 CTP( Community Technology Preview--CTP),并且支持開(kāi)發(fā)面向Windows 7的應(yīng)用程序。除了Microsoft SQL Server,它還支持 IBM?DB2和Oracle數(shù)據(jù)庫(kù)。
VB.NET即Visual Basic.NET是基于微軟.NET Framework之上的面向?qū)ο蟮木幊陶Z(yǔ)言。
其在調(diào)試時(shí)是以解釋型語(yǔ)言方式運(yùn)作,而輸出為EXE程序是是以編譯型語(yǔ)言方式運(yùn)作。
可以看作是Visual Basic在.Net Framework平臺(tái)上的升級(jí)版本,增強(qiáng)了對(duì)面向?qū)ο蟮闹С帧4蠖嗟腣B.Net程序員使用Visual Studio .Net作為IDE(integrated development environment).SharpDevelop是另一種可用的開(kāi)源的IDE。
網(wǎng)頁(yè)題目:vb>net書(shū)籍 visual basic net書(shū)籍
轉(zhuǎn)載注明:http://www.chinadenli.net/article20/dddjsjo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、手機(jī)網(wǎng)站建設(shè)、云服務(wù)器、網(wǎng)站設(shè)計(jì)、網(wǎng)站內(nèi)鏈、網(wǎng)站策劃
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)