VB ¶ÁÖ¸¶¨ÐÐ
http://zhidao.baidu.com/question/81532606.html
VB ¶ÁÖ¸¶¨ÐÐ
ÐüÉÍ·Ö£º10 - ½â¾öʱ¼ä£º2009-1-20 11:41
vbÖÐÈçºÎ¶ÁÈ¡Ö¸¶¨ÐеÄÄÚÈÝ£¬´°ÌåÉÏÓÐÁ½¸ö±êÇ©£¬ÎļþÔÚC:\A.TXT,Ëĸö°´Å¥£¬µ¥»÷µÚÒ»¸ö£¬¶ÁÎļþµÄµÚÒ»Ðе½±êÇ©Ò»£¬µÚ¶þÐе½±êÇ©¶þ£»µ¥»÷µÚ¶þ¸ö°´Å¥£¬µÚÈýÐе½±êÇ©Ò»£¬µÚËÄÐе½±êÇ©¶þ£»ÒÔ´ËÀàÍÆ£¬Ð»Ð»
ÌáÎÊÕߣº imyangmo - ÊéÉú ¶þ¼¶
×î¼Ñ´ð°¸
ÓÃÎļþϵͳ¿ÉÒÔ¶ÁÈ¡Ö¸¶¨ÐС£¡£¡£µ«ÊÇÈç¹ûÎļþÄÚÈݲ»ÊǺܶàµÄ»°ÓÃ˳ÐòÎļþÈ«²¿¶Á³öÀ´½Ø¶Ïµ½Êý×éºóÌáÈ¡Ö¸¶¨Ðиü·½±ã¡£¡£¡£
ʹÓÃÎļþϵͳ¶ÁÈ¡Ö¸¶¨ÐУº
Ê×ÏÈÐèÒª“ÒýÓÔMicrosoft Scripting Runtime
Private Sub Command1_Click()
Dim FSO As New FileSystemObject
Dim TS As TextStream
Dim Str As String
If Dir("C:\A.txt") <> "" Then 'ÅжÏÎļþÊÇ·ñ´æÔÚ
Set TS = FSO.OpenTextFile("C:\A.txt", ForReading) 'ForReadingΪ¶Áģʽ,ÁíÍâÓÐдºÍ×·¼Óģʽ
Do Until TS.Line = 1 'Ìøµ½Ö¸¶¨ÐÐʱÖÕֹѻ·
TS.SkipLine 'Ìø¹ýÒ»ÐÐ
Loop
Str = TS.ReadLine '¶Á³öÐÐ,Îļþϵͳ¶ÁдλÖþÍÊǹâ±êËùÔÚµÄλÖÃ
Print Str
Else
MsgBox "Îļþ²»´æÔÚ£¡"
End If
'µ«ÊÇÎļþϵͳºÃÏñ²»ÄÜдָ¶¨ÐÐ
End Sub
----------------------------------------------------------------
ʹÓÃ˳ÐòÎļþ»ñÈ¡Ö¸¶¨ÐÐÄÚÈÝ
Private Sub Command1_Click()
Dim Arr
Dim Str As String
Dim i As Integer
Open "C:\A.txt" For Binary As #1
Str = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
Arr = Split(Str, vbCrLf)
For i = 0 To UBound(Arr)
Print Arr(i)
Next i
End Sub
Ïà¹ØÎĵµ£º
·ÖÀࣺVBѧϰ ×ֺţº ´ó´ó ÖÐÖРСС mid(×Ö·û´®£¬´ÓµÚ¼¸¸ö¿ªÊ¼£¬³¤¶È) ÔÚ[×Ö·û´®]ÖÐ[´ÓµÚ¼¸¸ö¿ªÊ¼]È¡³ö[³¤¶È¸ö×Ö·û´®]
ÀýÈç mid("СÐÀÎÞµÐ",1,3) Ôò·µ»Ø "СÐÀÎÞ"
instr(´ÓµÚ¼¸¸ö¿ªÊ¼,×Ö·û´®1,×Ö·û´®2) ´Ó¹æ¶¨µÄλÖÿªÊ¼²éÕÒ£¬·µ»Ø×Ö·û´®2ÔÚ×Ö·û´®1Öе ......
VBʵÏÖVC TabControl¿Ø¼þ
н¨Ò»¸ö¹¤³ÌÎļþProject1£¬
ÔÚ×ó²à¹¤¾ßÀ¸ÖеãÓÒ¼ü
ÔÚ³öÏÖµÄÑ¡ÏîÖеã“Components”£¬ÔÚ´ò¿ª´°¿ÚÖÐÕÒµ½“Controls”Ñ¡ÏîÒ²ÖеēMicrosoft Tabbed Dialog Control 6.0”£¬È»ºóµã“Ó¦ÓÔ“È·¶¨”Í˳ö¸Ãҳà ......
VBµ÷ÓÃϵͳµÄ"´òÓ¡»úÉèÖÃ"ºÍ"Ò³ÃæÉèÖÃ".
Option Explicit
Const FW_NORMAL = 400
Const DEFAULT_CHARSET = 1
Const OUT_DEFAULT_PRECIS = 0
Const CLIP_DEFAULT_PRECIS = 0
Const DEFAULT_QUALITY = 0
Const DEFAULT_PITCH = 0
Const FF_ROMAN = 16
Const CF_PRINTERFONTS = &H2
Const C ......
Option Explicit
Private Declare Function LoadCursor Lib "user32.dll" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32.dll" (ByVal hCursor As Long) As Long
Private Const IDC_HAND As Long = 32649
Private myHand_handle ......
½¨Á¢ VPN ²¦ºÅÈ«²¿´úÂëÈçÏÂ:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
......