1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

c# help

Discussion in 'C, C++, C#' started by thesatanlord, Nov 24, 2010.

  1. thesatanlord

    thesatanlord Newbie

    Joined:
    Nov 23, 2010
    Messages:
    2
    Likes Received:
    0
    hiya
    hope i can get help
    I am new to programming, started c#

    I have got a windows form with a listbox, button(start), lable showing the no: of items in the listbox and another label which shows the selected item of the listbox
    The problem is I want the program on click on button
    -> selects the item from the list
    -> then uses that item to access the web
    -> then waits for amount of time
    and then again restarts the operation again

    any help will be appreciated
    cheers
     
  2. Alchemical

    Alchemical Registered Member

    Joined:
    Jun 22, 2010
    Messages:
    90
    Likes Received:
    11
    Greetings SatanLord,

    You need to better define what you want. This is actually an essential part of effective coding. What do you mean by access the web?

    But essentially, yeah, you can do that. You need to learn a bit about how the whole c# windows form thing works. Double-click on the button in design view, that will take you to the button handler. Put code there as to what you want to do. Access the other form elements through their objects via their name property.

    Feel free to post more details & good luck.
     
  3. thesatanlord

    thesatanlord Newbie

    Joined:
    Nov 23, 2010
    Messages:
    2
    Likes Received:
    0
    hiya
    got everything sorted
    working just like i want

    but stuck at clearing the cookies
    can clear the cache but cant clear the cookies

    any help
    tr
     
  4. atomic999

    atomic999 Newbie

    Joined:
    Apr 22, 2009
    Messages:
    7
    Likes Received:
    1
    You have to set expiry time of cookies to negative value
    Code:
    private void ClearCookies(CookieCollection Cookies)
    {
        for (int i = 0; i < Cookies.Count; i++)
                    {
                        Cookies[i].Expires = DateTime.Now.Subtract(TimeSpan.FromHours(1));
                    }
    }
    
    This should work, code isn't optimal but I don't have time now to write something better, maybe later ;)