Results 1 to 2 of 2

Thread: copy text from xx line and paste it into textbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2010
    Posts
    131

    Unhappy copy text from xx line and paste it into textbox

    so basically what i want to do is open a text file(a downloaded web page like html or php, notepad supports opening them), and then copy the text that there is in line 41 for example, from the file into a textbox in my project. would this be possible? the whole idea of this is that i download the web page of a youtube video, open it, copy the download link that's in line 41, put it into the textbox and then download the video.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: copy text from xx line and paste it into textbox

    You'd use a WebClient to download the data. You can call DonwloadFile but I think you'd probably be better off calling DownloadString, because you don't really need a file.

    Once you've got the data, you need to decide exactly what to do with it. If it really is text separated by line breaks then you can simply call String.Split, using ControlChars.NewLine, ControlChars.Lf or both as the delimiters, depending on the data. That will produce a String array, from which you can get any element(s) you want by index.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width