打开应用程序窗口时无会话共享并避免浏览器中的导航按钮
我们使用 VBScript 代码打开应用程序窗口,以避免用户在打开 IE8 窗口时进行前进/后退导航。
这是使用的代码。
Set WshShell = CreateObject("shell.application")
Set IE=CreateObject("InternetExplorer.Application")
IE.menubar = 1
IE.toolbar = 0
IE.statusbar = 0
'here we open the application url
IE.navigate "http://www.google.com"
IE.visible = 1
WshShell.AppActivate(IE)
这工作正常,但问题是,如果用户打开多个窗口,会话 cookie 将在窗口之间共享。
为此,还有一个解决方案,我们可以在打开 IE 时使用 nomerge 选项
WshShell.ShellExecute "iexplore.exe", " -nomerge http://www.google.com", null, null, 1
。现在我们希望这两个选项都可用。即用户不应该能够向前/向后导航,并且如果打开两个窗口,则不应共享数据。
我们无法让这两件事一起工作。
另外,我们不想要任何全屏模式(即按 F11 后)
任何人都可以提供解决方案吗?
提前致谢。
We are using VBScript code to open the application window to avoid users having forward/back navigation while opening the IE8 window.
This is the code used.
Set WshShell = CreateObject("shell.application")
Set IE=CreateObject("InternetExplorer.Application")
IE.menubar = 1
IE.toolbar = 0
IE.statusbar = 0
'here we open the application url
IE.navigate "http://www.google.com"
IE.visible = 1
WshShell.AppActivate(IE)
This is working fine, however the problem is that if the user opens multiple windows the session cookies are shared accross the windows.
For this also there is a solution that we can use the nomerge option while opening the IE
WshShell.ShellExecute "iexplore.exe", " -nomerge http://www.google.com", null, null, 1
Now we want both these options to be available. i.e user should not be able to navigate forward/backward and also if two windows are opened data should not be shared.
We were not able to get both these things working together.
Also we do not want any full screen mode(i.e after pressing F11)
Can any one provide the solution?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请参阅此密切相关问题的答案:启动 Internet Explorer 7 中的新进程没有工具栏。有几种可行的选择,一种使用 Powershell,另一种使用一些笨拙的 VBScript。
See the answers for this very closely related question: Launch Internet Explorer 7 in a new process without toolbars. There are a couple of workable options, one using Powershell, and one using some cludgy VBScript.
据我了解,cookie 是通过实例设置的。多个浏览器窗口仍然是同一个实例。
您也许可以传递程序跟踪的某种 ID 参数,但浏览器不能。这样,无论程序如何运行,它都会有自己的“会话”ID。
我认为你可以使用 javascript 来完成此操作,并使用 asp.net 隐藏字段来读取它。这可能会给您带来您正在寻找的独特性。
From what I understand, cookies are set by instance. Multiple browser windows are still going to be the same instance.
You might be able to pass in a sort of ID parameter that the program tracks, but the browser doesn't. That way regardless of how the program runs, it will have its own 'session' ID.
I think you can do this with javascript, and reading it using a asp.net hidden field. This might give you the uniqueness you're looking for.
patmortech 回答的链接中提到的解决方案并不完美,因为 cookie 仍然共享。因此,在 AppToRun 变量中使用 -nomerge 选项,当用户在单台计算机中打开应用程序两次时,该选项会创建两个进程。
在 IE8 中,如果打开两个 Internet Explorer,那么它们将合并为单个进程,因此 -nomerge 选项会在不同进程中打开 IE8 实例。
The solution mentioned in the link answered by patmortech is not perfect, as the cookies were still shared. So used the -nomerge option in the AppToRun variable which creates two processes when user opens the application twice in the single machine.
In IE8 if two internet explorers are opened then they are merged into single process so the -nomerge option which opens the IE8 instances in difference processes.