本文整理汇总了C#中System.Windows.Forms.HtmlDocument.InvokeScript方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlDocument.InvokeScript方法的具体用法?C# HtmlDocument.InvokeScript怎么用?C# HtmlDocument.InvokeScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.HtmlDocument
的用法示例。
在下文中一共展示了HtmlDocument.InvokeScript方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOrCreateDocumentHandle
public static HtmlDocumentHandle GetOrCreateDocumentHandle(HtmlDocument htmlDocument)
{
var guidObj = htmlDocument.InvokeScript (c_getDocumentIdentification);
var docID = guidObj != null ? new HtmlDocumentHandle (Guid.Parse (guidObj.ToString())) : new HtmlDocumentHandle (Guid.NewGuid());
htmlDocument.InvokeScript (c_addDocumentIdentification, new object[] { docID.ToString() });
return docID;
}
示例2: ActionsBuilderWebView_DocumentCompleted
private void ActionsBuilderWebView_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// Set common properties (name, is scene or object, etc.)
_document = ActionsBuilderWebView.Document;
_document.GetElementById("ActionsBuilderObjectName").SetAttribute("value", _objectName);
if (isRootNode)
_document.InvokeScript("setIsScene");
else
_document.InvokeScript("setIsObject");
_document.InvokeScript("updateObjectName");
if (getProperty())
{
_document.GetElementById("ActionsBuilderJSON").SetAttribute("value", _jsonResult);
_document.InvokeScript("updateGraphFromJSON");
}
// Set lists of meshes, lights, cameras etc.
var gameScene = Loader.Global.IGameInterface;
gameScene.InitialiseIGame(false);
var meshes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Mesh);
fillObjectsList(meshes, "setMeshesNames");
var lights = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Light);
fillObjectsList(lights, "setLightsNames");
var cameras = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Camera);
fillObjectsList(cameras, "setCamerasNames");
fillSoundsList(meshes, "setSoundsNames");
// Need to subclass this, then allow 3ds Max usage
//Win32.SubClass(this.ActionsBuilderWebView.Handle);
}
示例3: JQ
public void JQ(HtmlDocument HD)
{
HtmlElement HE = HD.CreateElement("SCRIPT");
HE.SetAttribute("src", "https://code.jquery.com/jquery-1.11.1.min.js");
HD.Body.AppendChild(HE);
HtmlElement HE2 = HD.CreateElement("SCRIPT");
HE2.SetAttribute("text", Properties.Resources.attrNodeTopLeft);
HD.Body.AppendChild(HE2);
HD.InvokeScript("attrNodeTopLeft");
}
示例4: mainBrowser_DocumentCompleted
//.........这里部分代码省略.........
/************************************
* 작동하지 않는 서비스 있을시
************************************/
if (doc.GetElementById("urlError").InnerText.Trim() == "true")
{
urlError = true;
bbStartUrl = doc.GetElementById("bbStartUrl").InnerText.Trim();
bbEndUrl = doc.GetElementById("bbEndUrl").InnerText.Trim();
bbAnnounceUrl = doc.GetElementById("bbAnnounceUrl").InnerText.Trim();
libraryStartUrl = doc.GetElementById("libraryStartUrl").InnerText.Trim();
libraryEndUrl = doc.GetElementById("libraryEndUrl").InnerText.Trim();
dormStartUrl = doc.GetElementById("dormStartUrl").InnerText.Trim();
dormEndUrl = doc.GetElementById("dormEndUrl").InnerText.Trim();
mailStartUrl = doc.GetElementById("mailStartUrl").InnerText.Trim();
mailEndUrl = doc.GetElementById("mailEndUrl").InnerText.Trim();
}
/************************************
* 공지사항
************************************/
if (doc.GetElementById("announce").InnerText != null)
{
MessageBox.Show(doc.GetElementById("announce").InnerText, doc.GetElementById("announceTitle").InnerText);
}
if (currentVersion.IndexOf(lastestVersion) != -1)
{
loadingLabel.Text = "최신 버전입니다 :)";
}
else
{
loadingLabel.Text = "최신 버전이 아닙니다 :(";
}
mainBrowser.Navigate("https://portal.unist.ac.kr/EP/web/login/unist_acube_login_int.jsp");
}
/**********************************************************
*
* 로그인 창에서 변수 입력
*
**********************************************************/
loadingProgressBar.Value += 1;
if (e.Url.ToString() == "https://portal.unist.ac.kr/EP/web/login/unist_acube_login_int.jsp")
{
System.Threading.Thread.Sleep(2000);
doc = mainBrowser.Document as HtmlDocument;
doc.GetElementById("id").SetAttribute("value", Program.id);
doc.GetElementsByTagName("input")["UserPassWord"].SetAttribute("value", Program.password);
doc.InvokeScript("doLogin");
/************************************
* 포탈 로그인 단계
************************************/
loadingLabel.Text = "포탈 로그인중";
loadingProgressBar.Value += 5;
}
/**********************************************************
*
* 첫 로그인, 이름 저장, 학사 공지로 이동
*
**********************************************************/
if (e.Url.ToString() == "http://portal.unist.ac.kr/EP/web/portal/jsp/EP_TopFixed.jsp")
{
if (isPortalComplete == false)
{
/************************************
* 포탈 로그인 완료
************************************/
loadingLabel.Text = "포탈 로그인 완료";
loadingProgressBar.Value += 5;
portalCookie = mainBrowser.Document.Cookie;
welcomeLabel.Click += new EventHandler(welcomeLabel_Click);
userName = mainBrowser.DocumentTitle.ToString().Split('-')[1].Split('/')[0];
welcomeLabel.Text = userName + " 님 환영합니다 :^)";
portal = new Portal(portalCookie, this);
showBoardGrid(1);
isPortalComplete = true;
browser.Navigate(bbStartUrl);
}
else
{
browser.Navigate(bbStartUrl);
}
}
}
示例5: docHandler
private void docHandler(object sender,
WebBrowserDocumentCompletedEventArgs e)
{
doc = ((WebBrowser)sender).Document;
doc.InvokeScript("connectSocketServer");
}