十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
在按鈕的Click事件處理函數(shù)中,添加

創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)下花園,10余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220
dim str as string="..\help.html" '文件路徑名
System.Diagnostics.Process.Start(str)
先用System.IO.Directory.GetDirectories函數(shù)獲取子目錄的名稱(包括其路徑),再用System.IO.Path.GetFileName獲取子目錄的名稱。下面是代碼:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
For Each s In System.IO.Directory.GetDirectories("C:\Windows")
Console.WriteLine(System.IO.Path.GetFileName(s))
Next
End Sub
下面是部分輸出:
Application Data
AppPatch
assembly
BOCNET
Boot
Branding
ConfigSetRoot
Cursors
Debug
DigitalLocker
Downloaded Installations
Downloaded Program Files
ehome
en-US
Fonts
Globalization
Help
...
可能有更簡潔的方法,你可以到MSDN看看
System.IO.Directory.GetDirectories:
System.IO.Path.GetFileName:
通用 I/O 任務(wù):
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 '測試用
'否則給出提示
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) "肖忠 開發(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
個(gè)人意見,希望采納:
:你先了解一下:
啟動(dòng)項(xiàng)英文msconfig
alerter -錯(cuò)誤警報(bào)器,垃圾,關(guān)閉。
application layer gateway service -給與第三者網(wǎng)絡(luò)共享/防火墻支持的服務(wù),有些防火墻/網(wǎng)絡(luò)共享軟件需要。占用1。5mb內(nèi)存。
application management-用于設(shè)定,發(fā)布和刪除軟件服務(wù)。
automatic 更新s -windows自動(dòng)更新,K,滾!
background intelligent transfer service -這個(gè)服務(wù)原是用來實(shí)現(xiàn)http1.1服務(wù)器之間的信息傳輸,微軟稱支持windows更新時(shí)斷點(diǎn)續(xù)傳
clipbook - 用與局域網(wǎng)電腦來共享 粘貼/剪貼的內(nèi)容。(K,想得出?。?/p>
com+Event system -一些 COM+ 軟件需要,檢查你的 c:\program files\ComPlus Applications 目錄,沒東西可以把這個(gè)服務(wù)關(guān)閉.
COM+Event system application -同上
COmputer browser - 用來瀏覽局域網(wǎng)電腦的服務(wù),但關(guān)了也不影響瀏覽!垃圾
cryptographic services -windows更新時(shí)用來確認(rèn)windows 文件指紋的,我更新時(shí)才開啟一下。
DHCP client-靜態(tài)IP者需要(xDSL 等)小貓就不用了!!
Distributed link tracking client-用于局域網(wǎng)更新連接信息,比如在電腦A有個(gè)文件,在B做了個(gè)連接,如果文件移動(dòng)了,這個(gè)服務(wù)將會(huì)更 新信息。占用4兆內(nèi)存。
Distributed Transaction coordinator-無聊的東西。
DNS Client-DNS解析服務(wù)。。無聊~~
Error reporting service -錯(cuò)誤報(bào)告器,把windows中錯(cuò)誤報(bào)告給微軟,無聊~~~~~
*Event Log- 系統(tǒng)日志紀(jì)錄服務(wù),很有用于查找系統(tǒng)毛?。?/p>
Fast user switching compatibility-多用戶快速切換服務(wù)..無聊
help and support -幫助,無聊,還是無聊幫助..哈哈
Human interface device access-支持”弱智“電腦配件的。。比如鍵盤上調(diào)音量的按鈕等等。。
IMAPI CD-burning COM service -xp刻牒服務(wù),用軟件就不用了占用1。6兆內(nèi)存
Indexing service -恐怖的xp減速的東東?。?!關(guān)關(guān)關(guān)?。?!
Internet Connection Firewall(ICF).........-xp防火墻。。不用就關(guān)。
IPSEC Services-大眾用戶連邊都沾不上。
Logical Disk manager -磁盤管理服務(wù)。。需要時(shí)它會(huì)通知你,所以一般關(guān)。
Logical Disk manager administrative service-同上。
messenger -不是msn,不想被騷擾的話就關(guān)。注:妖刺就是利用這個(gè)。
MS software shadow copy provider-無用,據(jù)說是備份用的。。我看什么用都沒。
Net Logon-登陸 Domain Controller 用的,大眾用戶快關(guān)!
Netmeeting remote desktop sharing-用netmeeting 實(shí)現(xiàn)電腦共享。。暈!關(guān)??!
Network Connections - 上網(wǎng)/局域網(wǎng)要用的東東!
Network DDE -和clipbook一起用的,無聊~~~~
Network DDE DSDM -同上
Network 本地 Awareness-如有網(wǎng)絡(luò)共享或ICS/ICF可能需要.(服務(wù)器端)
NT LM Security support provider-telnet 服務(wù)用的東東,關(guān)?。?/p>
NVIDIA Driver Helper service -nvidia 顯卡幫助,關(guān)!
PDEngine - perfectdisk 引擎
PDScheduler -perfectdisk 計(jì)劃服務(wù)
PerFORMance logs and alerts-記錄機(jī)器運(yùn)行狀況而且定時(shí)寫入日志或發(fā)警告,內(nèi)容可能過于專業(yè),所以。。自己決定。
*Plug and Play- 自動(dòng)查測新裝硬件,即插即用,開著吧~~~
Portable media serial number-絕對(duì)無用,無聊之及。
Print Spooler -打印機(jī)用的,我打印時(shí)才開一下。
Protected Storage-儲(chǔ)存本地密碼和網(wǎng)上服務(wù)密碼的服務(wù),包括填表時(shí)的“自動(dòng)完成”功能。
QoS RSVP -關(guān)!就是那個(gè)20%的 QoS
Remote access auto connection manager-寬帶者/網(wǎng)絡(luò)共享可能需要??!
Remote desktop help session manager-遠(yuǎn)程幫助服務(wù),傻透,占用4兆內(nèi)存。
*Remote Procedure Call (RPC) -系統(tǒng)核心服務(wù)!
Remote Procedure Call LOCATOR-這個(gè)倒沒什么用,管理 RPC 數(shù)據(jù)庫服務(wù),占用1兆內(nèi)存。
remote registry -遠(yuǎn)程注冊(cè)表運(yùn)行/修改。大漏洞,還不快關(guān)?。?/p>
removable storage -一般情況下不用,磁帶備份用的。
routing and remote access-哈哈。。不知者關(guān)!
secondary logon-給與administrator 以外的用戶分配指定操作權(quán).暈~~~
security accounts manager-像 Protected Storage, IIS Admin 才需要。
server -局域網(wǎng)文件/打印共享需要的。
shell hardware detection-給有些配置自動(dòng)啟動(dòng),像內(nèi)存棒,和有些cd驅(qū)動(dòng)等
smart card -關(guān)!1。4兆內(nèi)存
smart card helper -關(guān)!
SSDP Discovery service-沒有什么硬件利用這個(gè)服務(wù)。。
system event notification-記錄用戶登錄/注銷/重起/關(guān)機(jī)信息。。誰管這些。。
system restore service -系統(tǒng)還原服務(wù),吃資源和內(nèi)存的怪獸。。雖然有時(shí)用到,自己決定。
task scheduler-windows 計(jì)劃服務(wù)啦,垃圾.
TCP/IP NetBIOS helper-如果你的網(wǎng)絡(luò)不用 Netbios 或WINS,關(guān)了.
Telephony - 撥號(hào)服務(wù),如果你的寬帶不用撥號(hào),那么關(guān)了它。
telnet -大漏洞,我第一個(gè)關(guān)的就是這個(gè).這根dos中 telnet 命令沒關(guān)系。2兆內(nèi)存。
terminal services-實(shí)現(xiàn)遠(yuǎn)程登錄本地電腦,快速用戶切換和遠(yuǎn)程桌面功能需要,
不用這些功能就關(guān)了吧。
themes -給xp打扮的東東,不要太花鍬的就關(guān)了。
uninterruptible power supply-停電保護(hù)設(shè)備用的。。。沒有的就關(guān)。
universal plug and play device host-同SSDP Discovery Service ,沒用.
upload manager-用來實(shí)現(xiàn)服務(wù)器和客戶端輸送文件的服務(wù),簡單文件傳輸不需要這個(gè)!
volume shadow copy-同MS Software Shadow Copy Provider,無用.
webclient-可能和以后的.net技術(shù)有聯(lián)系,安全起見,我關(guān)得實(shí)實(shí)的!
Windows Audio - 控制著你聽到的聲音。關(guān)了就沒聲音了?。?/p>
Windows Installer -windows的MSI安裝服務(wù),建議設(shè)成手動(dòng)。
windows image acquisition (WIA) -有些數(shù)碼相機(jī)和掃描器用的,我的掃描器覺得它沒用。
Windows Management Instrumentation - 滿重要的服務(wù),是管”服務(wù)依K”的,但關(guān)
了會(huì)出現(xiàn)奇怪的問題.
windows management 包含umentat
另外,團(tuán)IDC網(wǎng)上有許多產(chǎn)品團(tuán)購,便宜有口碑
msdn的幫助文檔都會(huì)在微軟中文官網(wǎng)附加在Visual Studio的開發(fā)環(huán)境中
VB是是一種編程語言。VBA主要VB是office上的應(yīng)用,VB.net可以說是VB的最新版本,如果就是業(yè)余或者剛?cè)腴T的話,語法什么的和VB幾乎完全一樣。只是語法上面,要求比VB要求規(guī)范,比方說VB6.0里面Text1="1"讀的出來,VB.net就會(huì)報(bào)錯(cuò),一定要textbox1.text="1"才可以。對(duì)于初學(xué)者來說,VB.net這種規(guī)范要求有益無害。
如果你想學(xué)的話,最好學(xué)VB.net,一來功能強(qiáng),二來,能幫助你學(xué)習(xí)基本概念。比方說我學(xué)VB的時(shí)候,什么是類一點(diǎn)概念都沒有。都是學(xué)了.net之后才懂得。三來么,學(xué)會(huì)了VB.net.學(xué)其他都很方便的。
但是如果就是用用excel的話么,VBA就可以了。不過說句老實(shí)話,光學(xué)VBA的話,很多東西理解起來比較難。我是最后學(xué)VBA的,看了書一個(gè)禮拜之后就能隨便編了。但是書上很多代碼的,我猜如果沒有VB基礎(chǔ),估計(jì)看不懂