</crop>
- <crop id="402" offsetX="0" offsetY="0" seed="Seed" harvestNum="3" isAnimation="0">
<insect position="0,0,0,0,0,0|67,-9,85,-39,111,-19|61,-46,83,-71,117,-46|0,0,0,0,0,0" />
<cropGrow value="21600,43200,64800,86400,108000,2000000000" />
<tip>12:</tip>
<name>二制服</name>
<gossip />
</crop>
- <crop id="403" offsetX="0" offsetY="0" seed="Seed" harvestNum="5" isAnimation="0">
<insect position="0,0,0,0,0,0|67,-9,93,-45,102,-21|78,6,91,-18,104,5|0,0,0,0,0,0" />
<cropGrow value="28800,61200,93600,129600,165600,2000000000" />
<tip>12:</tip>
<name>三制服</name>
<gossip />
</crop>
- <crop id="404" offsetX="0" offsetY="0" seed="Seed" harvestNum="4" isAnimation="0">
<insect position="0,0,0,0,0,0|69,1,80,-28,90,-7|65,-3,87,-47,98,-7|0,0,0,0,0,0" />
<cropGrow value="39600,82800,126000,172800,219600,2000000000" />
<tip>12:</tip>
<name>四制服</name>
<gossip />
循环截取id后面的402 403 404 。截取后显示在List1中。
谢谢了!
以上字符是存在FORM的TEXT1的。
请高手们指点。
加了悬赏了。请高手们帮我一下吧。我要的是代码。代码要注明。
解决问题的我可以另外加分。
追答唉,这么简单的问题还要写代码啊?
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7770
ClientLeft = 60
ClientTop = 345
ClientWidth = 9375
LinkTopic = "Form1"
ScaleHeight = 7770
ScaleWidth = 9375
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 4920
TabIndex = 2
Top = 7320
Width = 1335
End
Begin VB.ListBox List1
Height = 7080
Left = 5880
TabIndex = 1
Top = 120
Width = 3255
End
Begin VB.TextBox Text1
Height = 7095
Left = 120
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Text = "Form1.frx":0000
Top = 120
Width = 5655
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim tempStr As String
Dim S1 As Long, S2 As Long, Len1 As Long
Dim FindStr1 As String, FindStr2 As String, tempFind As String
FindStr1 = "<crop id=" & Chr(34)
FindStr2 = Chr(34) & " offsetX="
tempStr = Text1.Text
Len1 = Len(FindStr1)
Do
S1 = InStr(S1 + 1, tempStr, FindStr1)
If S1 < 1 Then List1.AddItem "查找结束": Exit Do
S2 = InStr(S1 + 1, tempStr, FindStr2)
If S2 < 1 Then List1.AddItem "在文本框里面没找到所需的结束字段": Exit Do
tempFind = Mid(tempStr, S1 + Len1, S2 - S1 - Len1)
List1.AddItem tempFind
Loop
End Sub
把上面的代码保存为文本文件,再把文件名改为form1.frm就可以了。
字数限制注释没戏。
大哥。对我要截取的字符好像没用。
你只是理论。我要的是代码。