Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

So I have a listbox I want to change, that looks like this:

enter image description here

How do I change the July value? I need this to be 100% automated and change it to January. I made a lot of accounts on various websites and need to change them all back to the same birthdate. Yes, I'm aware I'll have to find the ID of it, etc.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
393 views
Welcome To Ask or Share your Answers For Others

1 Answer

View the HTML of the website and identify the id and values of the dropdownlist, for example:

<select id="bdayMonthId" size="1" name="bdayMonth">
    <option value="">Month</>
    <option value="Jan">January</>
    <option value="Feb">February</>
    <option value="Mar">March</>
</select>

To pre-select the dropdownlist value in the WebBrowser control use this Winform code:

webBrowser1.Document.GetElementById("bdayMonthId").SetAttribute("value", "Feb");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...