usingSystem;
'v1D,r1{m0usingSystem.Collections.Generic;
kFsk U z0usingSystem.Text;
0Pm4J.F,O/l"tE0usingmshtml;
S&CalF0usingSHDocVw;
8EU'Ku
jT0l*sn0namespaceGetIEWindow
*D2`%]*hNVr$N0{51Testing软件测试网'](y%jMq1Jn I
S
classProgram51Testing软件测试网 k$W6?9F:H4EJ x
{51Testing软件测试网b1DxlL~e O)j4[
staticvoidMain(string[] args)51Testing软件测试网"Y|uS8PZ
{
&Y2VjG0OG't*Xi+O0 stringbrowerTitle ="百度一下,你就知道";51Testing软件测试网L/~z3d
SC!a,i
stringelementId ="kw";51Testing软件测试网2wM;GAE.idWk6U
stringinputValue ="my test";51Testing软件测试网.C1}hf}K"\lY6g [
varallBrowsers =newShellWindowsClass();
YLO1_/e5U0 IHTMLDocument2currDocument =null; 51Testing软件测试网1@].fr6d|.\jx
foreach(IWebBrowser2browserinallBrowsers)51Testing软件测试网9M5|9^$By \w
{
]|eCB0 if(((IHTMLDocument2)browser.Document).title
== browerTitle)51Testing软件测试网@Q\3UJ/V
{
-u
NQ
a9w|LYL0 currDocument = (IHTMLDocument2)browser.Document;51Testing软件测试网O4J#|"U Tby\5{s
}51Testing软件测试网#p6`*W$_/o"m
}
0Y+CM
K8H8wn.N0 IHTMLElementCollectionelements = currDocument.all;
2d2\S-V{+@J8r0 foreach(IHTMLElementelementinelement)51Testing软件测试网
F;g
p(V~jnhk
{51Testing软件测试网.`I.]f.gU/XN4V
if(element.id == elementId)51Testing软件测试网4M Sbg
^BE
{51Testing软件测试网,m%Ky
Cc.C@Z
element.setAttribute("value",
inputValue, 0);51Testing软件测试网q}%u7J z
}51Testing软件测试网(ZT
o5xS6R
}
YH,g#f&G I~1Qf0 Console.ReadLine();51Testing软件测试网 i
Q,o%e8c#a?T)\
}
4P Tyh|H8h/rvu0 }
(Kw!aq'A4`0}
*}0z`*AzB
]hh0