
Мне нужно узнать текст (13

Также нужен текст после второй такой же строчки...

Dim pos As Long
Dim txt as String
pos=InStr(1,text,"<font face=Arial size=2 color=#000000>")
if pos=0 then
msgbox "Некорректный файл!"
else
txt=mid$(text,pos,13)
end if
Mix писал(а):Хм..Что - то не то...
Уменя в txt получается <font face=Ar
Dim pos As Long
Dim txt as String
Dim sSearchString As String
sSearchString="<font face=Arial size=2 color=#000000>"
pos=InStr(1,text,sSearchString)
if pos=0 then
msgbox "Некорректный файл!"
else
txt=mid$(text,pos+Len(sSearchString),13)
end if
Private Sub Command1_Click()
Dim vData As Variant
Dim a As Integer, b As Integer
Dim pos1, pos2
Dim txt As String
vData = Me.Inet1.OpenURL("http://informer.gismeteo.ru/text/29846-1.JS", icString)
Open App.Path & "\Geo.txt" For Output As #1
Print #1, vData
pos1 = InStr(1, vData, "<font face=Arial size=2 color=#FFFFFF><b>")
pos2 = InStr(1, vData, "</b>")
pos1 = pos1 + 38
pos2 = pos2 - pos1
txt = Mid$(vData, pos1, pos2)
Label5.Caption = "г." & txt
pos1 = InStr(1, vData, "<font face=Arial size=2 color=#000000>")
pos2 = InStr(1, vData, "</b>")
pos1 = pos1 + 38
pos2 = pos2 - pos1
txt = Mid$(vData, pos1, pos2)
lblData.Caption = txt
pos1 = InStr(3, vData, "<font face=Arial size=2 color=#000000>")
pos2 = InStr(1, vData, "<br>")
pos1 = pos1 + 41
pos2 = pos2 - pos1
txt = Mid$(vData, pos1, pos2)
lblOblak.Caption = txt
pos1 = InStr(3, vData, "<br>")
pos2 = InStr(3, vData, "</font>")
pos1 = pos1 + 4
pos2 = pos2 - pos1
txt = Mid$(vData, pos1, pos2)
lblOsadk.Caption = txt
pos1 = InStr(1, vData, "<font face=Arial size=2 color=#000000><b>")
pos2 = InStr(4, vData, "</b>")
pos1 = pos1 + 41
pos2 = pos2 - pos1
txt = Mid$(vData, pos1, pos2)
lblTemp.Caption = txt
pos1 = InStr(2, vData, "<font face=Arial size=2 color=#000000><b>")
pos2 = InStr(5, vData, "</b>")
pos1 = pos1 + 41
pos2 = pos2 - pos1
txt = Mid$(vData, pos1, pos2)
lblWeter.Caption = txt
Close #1
End Sub
Open App.Path & "\Geo.txt" For Output As #1
Print #1, vData
Close #1
Private Sub Command1_Click()
If Inet1.StillExecuting Then Exit Sub
imgA.Picture = LoadPicture(App.Path & "\pict\pic" & CStr(a) & ".gif")
MSDN писал(а):Loads a bitmap, icon, or cursor from a resource (.res) file.
Syntax
LoadResPicture(index, format)
The LoadResPicture function syntax has these parts:
Part Description
index Required. Integer or string specifying the identifier (ID) of the data in the resource file. The resource whose ID is 1 is reserved for the application icon.
format Required. Value or constant that specifies the format of the data being returned, as described in Settings.
Settings
The settings for format are:
Constant Value Description
vbResBitmap 0 Bitmap resource
vbResIcon 1 Icon resource
vbResCursor 2 Cursor resource
Remarks
You can use the LoadResPicture function instead of referring to graphics stored in the Picture property of a Form or controls.
Storing bitmaps, icons, or cursors in and accessing them from resource files improves load time because you can load them individually as needed from the resource file, rather than all at once when a Form is loaded.
Using LoadResPicture is useful for localizing a Visual Basic application because the resources that need to be translated are isolated in one resource file and there is no need to access the source code or recompile the application.
Сейчас этот форум просматривают: Google-бот и гости: 3