CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    2

    Exclamation Hi Hows it going? I'm new and already need help!

    Hi guys! I'm Andrew! aka Sullydude!

    Ok so I've been following a tutorial on cod project called PONTA, basically it allows you to get your internet history from IE, and store it how you like. I currently have mine in a string. but the piece of code I'm trying to understand is this:


    url.DeleteHistoryEntry("http://www.facebook.com" + letters.Any() + "/" + letters.Any(), 1);

    As you can see I'm "attempting" to to delete a unknown url from facebook history. but the only problem I seem to be having is its not detecting whole words. so for instance


    the url is super long so I would like to delete the entire chain of characters by detecting if there's any text in the url. so for instance:

    url.DeleteHistoryEntry("http://www.facebook.com" + YOU + ARE + HERE + "/" + Random, 1);

    I would really like to delete the You, Are, Here, Random, without knowing what word or character they are. I'm trying to explain as best i can so sorry for any misunderstandings

    I'm trying to accomplish this with this string[]

    string[] letters = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "`", "~", "!", "@", "#", "4", "%", "^", "&", "*", "(", ")", "{", "}", ":", ";", "'", "\"", ",", ">",
    "," , ".", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\\", "/", "?"};

    PLAESE HELP!

    Thank you in advance

    - Sullydude

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Hi Hows it going? I'm new and already need help!

    Don't really have enough info, but letters.Any() isnt going to work in the way you expect

    Perhaps consider a loop that iterates through the history and if the url StartsWith() "http://www.facebook.com" then delete the entry
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  3. #3
    Join Date
    Jan 2012
    Posts
    2

    Re: Hi Hows it going? I'm new and already need help!

    Quote Originally Posted by cjard View Post
    Perhaps consider a loop that iterates through the history and if the url StartsWith() "http://www.facebook.com" then delete the entry
    The Only problem I see with that is if there is more than 1 entry that has the beginning "http://www.facebook.com". what if i want to keep 1. what I'd really like to do is detect if there is any form of characters in the url.

    so for instance, "http://www.Youtube.com/ifthereistextherethendelete;

    I would like to detect that there is any string after the youtube.com/.

    so if even it doesnt = ifthereistextherethendelete
    but = ifthereistextherethen(I)delete

    I would like to delete that as well.

    I appreciate all the help your giving me btw!

    - Sullydude

  4. #4
    Join Date
    Jan 2012
    Posts
    2

    Smile Re: Hi Hows it going? I'm new and already need help!

    try to read history as a text file.Than you make connection to that location :

    string filePath="C:\\Temp\\....." ---------------location of history file


    file = new StreamReader(filePath); ------------------constructor

    while ((line = file.ReadLine()) != null) ---------------read file from start to the end
    {


    if (line.Contains("facebook")) ---------------if line contains facebook
    {

    string x = line.Replace("facebook...", ""); --------------replace line with nothing
    }

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

Featured