c# - Why does HtmlElement's GetAttribute() method return "mshtml.HTMLInputElementClass" instead of the attribute's value? -
क्यों HtmlElement
के GetAttribute ()
विधि वापसी Mshtml.HTMLInputElementClass
विशेषता के मान के बजाय, जब मैं किसी प्रपत्र के क्रिया
विशेषता का मान प्राप्त करने की कोशिश कर रहा हूं?
HtmlElementCollection तत्व = webBrowser1 .Document.Forms; अग्रगण (तत्वों में एचटीएमएलएलिमेंट एलीमेंट्स) संदेश बॉक्स। दिखाना (तत्व। गेटअेट्रिब्यूट ("एक्शन") + "");
ऐसा लगता है कि एक IE बग
यहां एक समाधान है: Microsoft.mshtml के संदर्भ जोड़ें , फिर:
यदि (element.GetAttribute ("क्रिया")। बराबर ("mshtml.HTMLInputElementClass")) {mshtml.IHTMLFormElement iForm = (mshtml.IHTMLFormElement) element.DomElement; स्ट्रिंग एक्शन = iForm.action; }
इस सहायता की आशा करें:)
Comments
Post a Comment