如何使用C++/WinAPI将Internet Explorer控件嵌入到我的应用程序中?
我发誓我已经搜查过; 我找不到任何关于此的文件.
我有以下用VB.NET编写的控制台应用程序:
Sub Main()
Dim ie As Object = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate2("http://localhost:4631/Default.aspx")
End Sub
Run Code Online (Sandbox Code Playgroud)
该程序使用InternetExplorer.Application自动化对象启动IE窗口并浏览给定的URL。我遇到的问题是,即使我启动了应用程序的多个实例,使用此方法创建的IE窗口也都共享同一个cookie容器。我可以使用任何参数指定为每个窗口创建一个不同的cookie容器吗?
这是我用来测试Cookie的网页:
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
// Store something into the session in order to create the cookie
Session["foo"] "bar";
Response.Write(Session.SessionID);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<form id="form1" runat="server"></form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)