vb.net - Extract a single line from a webpage VB2008 -
i'm looking extract line starts "a sunot..." website. https://pilotweb.nas.faa.gov/common/nat.html
i want paste line text box in vb2008.
i tried using:
public class form1 private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim tracka system.net.httpwebrequest = system.net.httpwebrequest.create("https://pilotweb.nas.faa.gov/common/nat.html") dim gather system.net.httpwebresponse = tracka.getresponse dim write system.io.streamreader = new system.io.streamreader(gather.getresponsestream) rawdata.text = write.readline(?) end sub end class
i got write entire page wanted line. '?' show if readline command right thing using there.
thanks, james
try following code
private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim tracka system.net.httpwebrequest = system.net.httpwebrequest.create("https://pilotweb.nas.faa.gov/common/nat.html") dim gather system.net.httpwebresponse = tracka.getresponse dim write system.io.streamreader = new system.io.streamreader(gather.getresponsestream) dim contentstr string = write.readtoend dim startindex integer = contentstr.indexof("a sunot") dim strlength integer = contentstr.indexof(vblf, startindex) - startindex rawdata.text = contentstr.substring(startindex, strlength) end sub
Comments
Post a Comment