using mshtml; /// <summary>
/// Returns a reference to the frame window with an given index in the top level document of the Webbrowser control
/// </summary>
/// <param name="frameIndex">zero-based index that specifies the index of the frame window</param>
[CLSCompliant(false)]
public IHTMLWindow2 GetFrameByIndex(int frameIndex)
{
IHTMLDocument2 htmlDocument = (IHTMLDocument2)this.Document.DomDocument;
return GetFrameByIndex(frameIndex, htmlDocument);
}
/// <summary>
/// Returns a reference to the frame window with an given index in an HTML document
/// </summary>
/// <param name="frameIndex">zero-based index that specifies the index of the frame window</param>
/// <param name="htmlDocument">the HTML document to search in</param>
[CLSCompliant(false), ComVisible(false)]
static public IHTMLWindow2 GetFrameByIndex(int frameIndex, IHTMLDocument2 htmlDocument)
{
if (htmlDocument == null)
return null;
object oIndex = frameIndex;
object oFrame=htmlDocument.frames.item(ref oIndex);
if (oFrame== null) return null;
return (IHTMLWindow2)oFrame;
}
/// Returns a reference to the frame window with an given index in the top level document of the Webbrowser control
/// </summary>
/// <param name="frameIndex">zero-based index that specifies the index of the frame window</param>
[CLSCompliant(false)]
public IHTMLWindow2 GetFrameByIndex(int frameIndex)
{
IHTMLDocument2 htmlDocument = (IHTMLDocument2)this.Document.DomDocument;
return GetFrameByIndex(frameIndex, htmlDocument);
}
/// <summary>
/// Returns a reference to the frame window with an given index in an HTML document
/// </summary>
/// <param name="frameIndex">zero-based index that specifies the index of the frame window</param>
/// <param name="htmlDocument">the HTML document to search in</param>
[CLSCompliant(false), ComVisible(false)]
static public IHTMLWindow2 GetFrameByIndex(int frameIndex, IHTMLDocument2 htmlDocument)
{
if (htmlDocument == null)
return null;
object oIndex = frameIndex;
object oFrame=htmlDocument.frames.item(ref oIndex);
if (oFrame== null) return null;
return (IHTMLWindow2)oFrame;
}
var nums = document.getElementsByName('nums');
var Volume = document.getElementsByName('Volume');
if (numsSource.length == nums.length) {
for (i=0;i<numsSource.length;i++) {
if (numsSource[i] == '0') {
nums[i].innerHTML = ' '; //!!!这里得nums[i]就是我要获得的数据
Volume[i].innerHTML = ' '; }
else {
/*
// Change et colors
if (nums[i].innerHTML != '' && Volume[i].innerHTML != '' && (nums[i].innerHTML != numsSource[i] || Volume[i].innerHTML != VolumeSource[i])) {
nums[i].style.color='#FFFFFF';
Volume[i].style.color='#FFFFFF';
}
*/
nums[i].innerHTML = numsSource[i];
Volume[i].innerHTML = VolumeSource[i];
}
}
}
else {
window.location.reload();
}
}这段代码我读出来了,我要得到得就是nums[i]这些数据 请问如何取的这些数据,小弟非常感谢~!
HtmlWindow PopupOptionWindow()
{ IHTMLAnchorElement ae = extendedWebBrowser1.GetLinkByHref("popupEligiNewRT");
if (ae != null)
{
Debug.WriteLine(ae.href);
//javascript:popupEligiNewRT('DIANA%20JOHN%20W',%20'SUB','form0') //function popupEligiNewRT(name,opt,form){
// var str = "eligipopup.jsp?&name="+name+"&opt="+opt+"&form="+form;
// window.open(str, 'popupeligiwin', 'width=600,height=375,left=250,top=100,menubar=yes,status=yes,toolbar=no');
//}
string href = ae.href;
href = href.Substring(
href.IndexOf("("));
String delim = "()";
href = href.Trim(delim.ToCharArray());
string[] parameters = href.Split(",".ToCharArray());
delim = "'";
string name = parameters[0].Trim(delim.ToCharArray());
string opt = parameters[1].Trim(delim.ToCharArray());
string form = parameters[2].Trim(delim.ToCharArray());
string PopupURL = string.Format("https://www.example.com/eligipopup.jsp?&name={0}&opt={1}&form={2}", name, opt, form);
return extendedWebBrowser1.Document.Window.Open(PopupURL, "autopopupeligiwin", "width=600,height=375,left=250,top=100,menubar=yes,status=yes,toolbar=no", false);
}
return null;
}