Beispiel #1
0
    public IEnumerable <URL> GetHistory()
    {
        // Initiate main object
        UrlHistoryWrapperClass urlhistory = new UrlHistoryWrapperClass();

        // Enumerate URLs in History
        UrlHistoryWrapperClass.STATURLEnumerator enumerator =
            urlhistory.GetEnumerator();
        // Iterate through the enumeration
        while (enumerator.MoveNext())
        {
            // Obtain URL and Title
            string url = enumerator.Current.URL.Replace('\'', ' ');
            // In the title, eliminate single quotes to avoid confusion
            string title = string.IsNullOrEmpty(enumerator.Current.Title)
                ? enumerator.Current.Title.Replace('\'', ' ') : "";
            // Create new entry
            URL U = new URL(url, title, "Internet Explorer");
            // Add entry to list
            URLs.Add(U);
        }
        // Optional
        enumerator.Reset();
        // Clear URL History
        urlhistory.ClearHistory();
        return(URLs);
    }
Beispiel #2
0
        public DataTable GetHistory()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("Title");
            dt.Columns.Add("URL");

            UrlHistoryWrapperClass urlhistory = new UrlHistoryWrapperClass();

            UrlHistoryWrapperClass.STATURLEnumerator enumerator = urlhistory.GetEnumerator();

            while (enumerator.MoveNext())
            {
                try
                {
                    string url   = enumerator.Current.URL.Replace('\'', ' ');
                    string title = string.IsNullOrEmpty(enumerator.Current.Title)
                              ? enumerator.Current.Title.Replace('\'', ' ') : "";

                    dt.Rows.Add(new string[] { title, url });
                }
                catch
                {
                }
            }

            enumerator.Reset();
            urlhistory.ClearHistory();

            return(dt);
        }
Beispiel #3
0
        /// <summary>
        /// Gets the ie history.
        /// </summary>
        /// <returns>get list of ie histroy</returns>
        public static List <BrowserHistory_Node> OnGetIEHistory()
        {
            List <BrowserHistory_Node> URLs = new List <BrowserHistory_Node>();

            UrlHistoryWrapperClass.STATURLEnumerator enumerator;
            UrlHistoryWrapperClass urlHistory;

            urlHistory = new UrlHistoryWrapperClass();
            enumerator = urlHistory.GetEnumerator();


            while (enumerator.MoveNext())
            {
                BrowserHistory_Node HistoryNode = new BrowserHistory_Node();
                if (enumerator.Current.URL != null)
                {
                    HistoryNode.url = enumerator.Current.URL.ToString();
                }
                if (enumerator.Current.Title != null)
                {
                    HistoryNode.title = enumerator.Current.Title.ToString();
                }
                HistoryNode.create    = FILETIMEToLong(enumerator.Current.ftLastUpdated);
                HistoryNode.lastvisit = FILETIMEToLong(enumerator.Current.ftLastVisited);
                URLs.Add(HistoryNode);
            }
            enumerator.Reset();


            return(URLs);
        }
Beispiel #4
0
        public List <HistoryItem> GetHistory(int NumURL)
        {
            UrlHistoryWrapperClass urlHistory;

            UrlHistoryWrapperClass.STATURLEnumerator enumerator;
            List <STATURL> list = new List <STATURL>();

            urlHistory = new UrlHistoryWrapperClass();
            enumerator = urlHistory.GetEnumerator();
            enumerator.GetUrlHistory(list);
            int Count = 0;

            foreach (STATURL url in list)
            {
                if (Count == NumURL)
                {
                    break;
                }
                HistoryItem item = new HistoryItem();
                item.URL         = url.URL;
                item.Title       = url.Title;
                item.VisitedTime = DateTime.Now;
                URLs.Add(item);
                Count++;
            }
            return(URLs);
        }
Beispiel #5
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            urlHistory = new UrlHistoryWrapperClass();
            enumerator = urlHistory.GetEnumerator();
            list       = new ArrayList();
        }
Beispiel #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            UrlHistoryWrapperClass urlHistoryWrapper = new UrlHistoryWrapperClass();

            UrlHistoryWrapperClass.STATURLEnumerator enumerator
                = urlHistoryWrapper.GetEnumerator();

            DataTable hackingtable = new DataTable();

            DataColumn DC1 = new DataColumn("Folders Being Used");

            //DataColumn DC2 = new DataColumn("Browsing Site Title");

            hackingtable.Columns.Add(DC1);
            //hackingtable.Columns.Add(DC2);

            while (enumerator.MoveNext())
            {
                string url   = enumerator.Current.URL;
                string title = "";

                try
                {
                    title = string.IsNullOrEmpty(enumerator.Current.Title)
                        ? enumerator.Current.LastVisited.ToLongDateString() : "";
                }
                catch (Exception ex)
                {
                }
                int val  = url.IndexOf("www");
                int val1 = url.IndexOf("ttp");
                int val2 = url.IndexOf("ttps");
                if (val > 0 || val1 > 0 || val2 > 0)
                {
                }
                else
                {
                    DataRow dr = hackingtable.NewRow();
                    dr[0] = url;
                    //dr[1] = title;
                    hackingtable.Rows.Add(dr);
                }
            }
            dataGridView1.DataSource = hackingtable;
        }
        private UrlHistoryWrapperClass.STATURLEnumerator GetHistoryEnumerator()
        {
            var historyWrapper = new UrlHistoryWrapperClass();

            return(historyWrapper.GetEnumerator());
        }