Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C# Programming › C# msHtml problem.

C# msHtml problem.

Posts 1–6 of 6 · Page 1 of 1
VI
vitaminb2
C# msHtml problem.
Hello, im cuncurently working on a chatbot for a chatsite. But i got a problem with accesing the button with the value ("Start new chat")

on the line: foreach (HTMLInputElement child in elementCollection) the debugger gives me an error: HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))



Code:
private void button1_Click(object sender, EventArgs e)
        {
            HTMLDocument MyDoc = (HTMLDocument)ie.Document;
            HTMLElementCollection elementCollection = (HTMLElementCollection)MyDoc.getElementById("logbox");
            foreach (HTMLInputElement child in elementCollection)
            {
                if (child.value == "Start new chat")
                    child.click();
                
            }
        }
Ive searched on google for a awnser, But with no succes.

I hope somebody can help me with this error..
#1 · edited 12y ago · 12y ago
abuckau907
abuckau907
GetElementById

Not

GetElementsById

It returns a single item. Why are you treating it like a collection? No loop is needed if you're using GetElementById.
#2 · edited 12y ago · 12y ago
VI
vitaminb2
Quote Originally Posted by abuckau907 View Post
GetElementById

Not

GetElementsById

It returns a single item. Why are you treating it like a collection? No loop is needed if you're using GetElementById.
Becuase i cant acces the button by its id.

Its a childElement of the logbox. so i have to use a loop trough the logbox element.

But there is no good example on the web to actually do something with the element the loop is looking for.
#3 · 12y ago
abuckau907
abuckau907
Why can't you access the button by its id?
Its a childElement of the logbox. so i have to use a loop trough the logbox element.
By that logic EVERYTHING is a "child" of the <html> root element and you couldn't access anything by it's id. (?)



please post the html code for the <form>. Erase any parts we don't need to see (hardcoded styling, etc).

something very similar to
Code:
<form id="logbox" method="post">
...
<input type=submit value="Start new chat" />
</form>
so we can see the names and IDs of the controls, and their layout.



I haven't used these classes/functions in a while so I made up a demo to test...maybe it helps give you ideas..

http://tinypic.com/r/20zvcr8/8


 
text copy of vb.net code above, 99.9% the same as c# (in this example)

Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate("C:/Users/Buckau/Desktop/index.html")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim _entirePage As HtmlDocument = WebBrowser1.Document

        ''Find the login <form>
        Dim _logBox As HtmlElement = _entirePage.GetElementById("logbox")
        If _logBox Is Nothing Then
            MsgBox("Log box not found!")
            Exit Sub
        End If

        ''We found it
        MsgBox("_logBox.InnerText: " & Environment.NewLine & _logBox.InnerText _
             & Environment.NewLine & Environment.NewLine _
             & "_logBox.InnerHtml: " & Environment.NewLine & _logBox.InnerHtml)
        If _logBox.Children.Count > 0 Then
            ''Loop over it's children 
            Dim _tmpStr As String = ""
            For Each xx As HtmlElement In _logBox.Children
                _tmpStr = xx.GetAttribute("value")
                If String.IsNullOrEmpty(_tmpStr) Then
                    MsgBox("input doesn't have a 'value' item" & Environment.NewLine _
                         & "name: " & xx.Name)
                Else
                    MsgBox("name: " & xx.Name & Environment.NewLine _
                          & "value = " & _tmpStr)
                End If
            Next
        Else
            MsgBox("The _logBox has No Children Elements! ie. an empty <form></form>.")
        End If

        MsgBox("Done analyzing") ''
    End Sub

The test html file I practiced on:
Code:
<html>
<head>
<title>yunoTest</title>
</head>
<body>

<form id="logbox" method="post">

<input type="text" name="email" value="youremail@mail.com" /><br />
<input type="password" name="password" value="********" /><br />
<input type=submit value="Start new chat" />

</form>

</body>
</html>
tip: Use HtmlElement instead of HtmlInputElement (unless you KNOW all your items will be <input> elements). GetAttribute() is useful..but make sure it returns something other than empty string.
Find the logbox form based on it's ID, then loop over its children, looking for one who has a defined attribute named 'value', with the value "Start new Chat": this is your button.
Look forward to your reply.
#4 · edited 12y ago · 12y ago
Drokechas
Drokechas
Also you must use Name, than not exist ID

Quote Originally Posted by vitaminb2 View Post
Hello, im cuncurently working on a chatbot for a chatsite. But i got a problem with accesing the button with the value ("Start new chat")

on the line: foreach (HTMLInputElement child in elementCollection) the debugger gives me an error: HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))



Code:
private void button1_Click(object sender, EventArgs e)
        {
            HTMLDocument MyDoc = (HTMLDocument)ie.Document;
            HTMLElementCollection elementCollection = (HTMLElementCollection)MyDoc.getElementById("logbox");
            foreach (HTMLInputElement child in elementCollection)
            {
                if (child.value == "Start new chat")
                    child.click();
                
            }
        }
Ive searched on google for a awnser, But with no succes.

I hope somebody can help me with this error..
#5 · 12y ago
VI
vitaminb2
Thanks for the reply's. Ive managed to get it working with a timer that constanly checks if the chat has been stopped. if it does, the program presses the button
#6 · 12y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

  • WPE problem...By styx23 in General Game Hacking
    8Last post 20y ago
  • Problem Wit Hacking ProgramsBy f5awp in General Gaming
    5Last post 20y ago
  • hacking problemsBy iwillkillyou in WarRock - International Hacks
    11Last post 20y ago
  • To All GunZ Down 02-07-06 PROBLEMBy WertyRO in Gunz General
    18Last post 20y ago
  • ProblemBy lambda in Gunz General
    3Last post 20y ago

Tags for this Thread

#coding#hellp#help me#programing