vb.netoa源碼 vb編程源碼

用vb.net編寫記事本源代碼

Dim sFileName As String

專注于為中小企業(yè)提供做網(wǎng)站、成都做網(wǎng)站服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)朝陽免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了上1000+企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

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("請輸入要查找的字詞:")

Dim Where1 '獲取需要查找的字符串變量

Text1.SetFocus '文本框獲得焦點(diǎn),以顯示所找到的內(nèi)容Search = InputBox("請輸入要查找的字詞:")

Where1 = InStr(Text1.Text, Search) '在文本中查找字符串

If Where1 Then

'若找到則設(shè)置選定的起始位置并使找到的字符串高亮

Text1.SelStart = Where1 - 1

Text1.SelLength = Len(Search)

' Me.Caption = Where1 '測試用

'否則給出提示

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) "文本編輯器版本號1.0" Chr(13) "由西南財(cái)經(jīng)大學(xué)天府學(xué)院" Chr(13) Space(5) "肖忠 開發(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() '打開文件代碼

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程序源碼如何使用

你需要安裝vb6.0開發(fā)軟件

如果安裝了,就可以直接打開源碼測試了,后綴名是vbp,(就是vb的工程文件)

如果沒有安裝vb6.0,還想打開源碼看程序,那就右擊 用記事本 打開后綴名為frm的文件,他是vb的窗口文件,源碼都在他里面

一般得源碼是沒有生成exe可執(zhí)行文件的,那樣文件太多,太大,浪費(fèi)空間

如果你自己想生成exe可執(zhí)行文件,那就vb6.0得文件菜單中把文件保存成exe可執(zhí)行文件就可以了,非常簡單

好運(yùn)!

如何用vb.net獲取網(wǎng)頁源代碼

使用webbrowser控件來加載網(wǎng)頁,然后再

Private

Sub

WebBrowser

1_DocumentCompleted下通過使用WebBrowser1.Document.Body.

InnerHtml

來獲取網(wǎng)頁的源代碼,或使用

WebBrowser1.Document.Body.InnerText來獲取網(wǎng)頁中的文本。之后可以通過字符串控制指令或者

正則表達(dá)式

來精確獲取到你所需的數(shù)據(jù)。

誰有vb.net+sqlserver開發(fā)的《庫存管理系統(tǒng)》的源碼和源文件??

1.顯示直觀,點(diǎn)擊“名稱”中的“加號”展開下拉菜單,顯示裝備的詳細(xì)情況和維修情況,簡潔清楚;

2.更為實(shí)用的搜索功能;

3.數(shù)據(jù)庫防遠(yuǎn)程下載;

4.后臺操作簡簡潔,信息錄入非常方便;

5.管理員分為三個(gè)等級;

6.出于好玩,添加了萬年歷、手機(jī)號碼查詢、郵編查詢功能;

7.所有在系統(tǒng)中使用到的廣告圖片的源文件(png格式,fireworks制作)均保存于(fire文件夾中)。

vb.NET webbrowser 修改網(wǎng)頁源碼

Dim c

Private Sub Form_Load()

URL = ""

c = 0

WebBrowser1.Navigate URL

End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)

If c = 1 Then Exit Sub '這個(gè)是為了防止這個(gè)過程無限執(zhí)行下去

c = c + 1

tmp = WebBrowser1.Document.body.innerhtml

tmp = Replace(tmp, "88753967", "好玩嗎?")

WebBrowser1.Document.body.innerhtml = tmp

End Sub

如何用vb.net獲得網(wǎng)頁的源代碼

Dim url As String=" 網(wǎng)址"

Dim httpReq As System.Net.HttpWebRequest

Dim httpResp As System.Net.HttpWebResponse

Dim httpURL As New System.Uri(url)

httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)

httpReq.Method = "GET"

httpResp = CType(httpReq.GetResponse(), HttpWebResponse)

httpReq.KeepAlive = False ' 獲取或設(shè)置一個(gè)值,該值指示是否與

Internet資源建立持久連接。

Dim reader As StreamReader = _

New StreamReader(httpResp.GetResponseStream,

System.Text.Encoding.GetEncoding(-0))

Dim respHTML As String = reader.ReadToEnd() 'respHTML就是網(wǎng)頁源代碼

網(wǎng)頁題目:vb.netoa源碼 vb編程源碼
本文網(wǎng)址:http://www.muchs.cn/article28/hhiccp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、全網(wǎng)營銷推廣、、小程序開發(fā)、網(wǎng)站策劃、移動網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名