°ïÎҸĸÄÕâVBÌâ - VB / »ù´¡Àà
°ïÎÒ¸Ä¸Ä ÎÒ×ܾõµÃÓÐÎÊÌâ
Type ID
number As Single
score As Integer
name As String * 6
End Type
Dim personl As ID, i%
Private Sub Command1_Click()
i = 0
xpath = App.Path & "\ku\score.txt"
Open xpath For Random As #1 Len = Len(personl)
personl.number = Val(Text1.Text)
personl.score = Val(Text2.Text)
personl.name = Text3.Text
Put #1, Val(Text4.Text), personl
i = i + 1
Close #1
MsgBox "ѧÉúÐÅÏ¢ÒÑдÈ룡", vbInformation
Label1.Caption = "×ܼǼÊý£º" + i
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command2_Click()
xpath = App.Path & "\ku\score.txt"
Open xpath For Random As #1 Len = Len(personl)
Get #1, Val(Text4.Text), personl
Text1.Text = personl.number
Text2.Text = personl.score
Text3.Text = personl.name
End Sub
ÄÄÀïÓÐÎÊÌ⣿
±ð¿¼ÈË£¡
VB code:
Private Type ID
number As Single
score As Integer
name As String * 6
End Type
Dim personl As ID, i%
Private Sub Command1_Click()
xp
Ïà¹ØÎÊ´ð£º
±ÈÈç½ø³Ì¼ÓÔØÐµijÌÐò¡£
ÔÚÆäÔËÐÐ֮ǰ×èÖ¹¡£
È»ºóÔÊÐíºó·ÅÐС£
±ÈÈç³ÌÐòÖ÷Îļþ·¾¶ÊÇc:\test\test.exe£¬½¨Á¢ÄÚÈÝÈÎÒâµÄÎļþc:\test\test.exe.manifest¡£
¾ÍÊDz»ÖªµÀ³ÌÐòÎļþ·¾¶¡£
ÉèÖ ......
VBżѧµÃ²»´í£¬ÏÖÔÚ´óÒ»£¬¸ßÈýµÄʱºò¾ÍѧVBÁË£¬ÏÖÔÚѧУÀï¶¼ÊÇѧC#ºÍVB.NETµÄÐֵܶࡣ¡£¡£
żҪתÐÐVB.NETÁË~µ±ÄêѧVBѧÁË2Ä꣬¶ÔVBÀïÃæµÄ³£Óú¯Êý¶¼Ê®·ÖÁ˽⡣
Select¡¢If½á¹¹¡¢For NextÑ»·¡¢µÈ¶¼Á˽⡣¡£¡£ ......
ÔÚvbÕâ±à³ÌÀïËÆºõÓкܶàµÄ¶«Î÷ÊÇÏàÁªÏµµÄ£¬ÎªÊ²Ã´ÓÐЩÈ˶ÔvbµÄ±à³ÌÃþ²»µ½Í·ÄÔ°¡£¡²¢ÇÒÓÐЩʺÜÈÝÒ׵쬵«ÊÇÈ´°ÑËüÃǵĴúÂë±ä³É¸´ÔÓ£¬Ò²È¥ÏëһЩ²»ÄÜʵÏֵĶ«Î÷°¡£¡
û·ÖÁË£¬Â¥Ö÷¶àÀ´µã·Ö£¡
À´½Óµã·Ö
......
ÕжÔÈÕVB¹¤³Ìʦ
ÒªÇó¶þÄêÒÔÉϵÄVB¾Ñé
Óйý¶ÔÈÕÏîÄ¿µÄ×îºÃ£¬ÄÜ¿´¶®ÈÕÓïµÄ
ÓкÏÊʵķ¢¼òÀúµ½ÓÊÏäxiaocm2004@163.com
¸çÃÇ
´óÁ¬ÓÐÄãµÄµØÅÌÂð£¿
VBû×ö¹ýÕ¦Õû£¡
VB6µ¹ÊÇûÎÊÌ⣬¿Éϧ²»¶®ÈÕ ......