CppWebBrowser中使用session进行权限判断,在新窗口中如果传递?
权限用session来判断
现在有2个窗口,w1和w2,分别包含CppWebBrowser1和CppWebBrowser2
在w1的CppWebBrowser1打开新窗口的时候,在w2的CppWebBrowser2显示,
怎样把session值传到CppWebBrowser2,不然权限判断就无发执行了?
[解决办法]
Navigates to a resource identified by a path name or URL.
void __fastcall Navigate(BSTR URL, TVariant* Flags=TNoParam(), TVariant* TargetFrameName=TNoParam(), TVariant* PostData=TNoParam(), TVariant* Headers=TNoParam());
Description
Use Navigate to locate and download a specific resource. Navigate can send an HTTP message to a specified URL and display the results or simply display the results of a specified file.
URL specifies the UNC path name of a file or the Uniform Resource Locator of an Internet resource that the Web browser should display.
Flags is a set of values that specify whether to add the resource to the history list, whether to read from or write to the cache, and whether to display the resource in a new window. It can be a sum of zero or more of the following:
ConstantValueMeaning
navOpenInNewWindow1Open the resource or file in a new window.
navNoHistory2Do not add the resource or file to the history list. The new page replaces the current page in the list.
navNoReadFromCache4Do not read from the disk cache for this navigation.
navNoWriteToCache8Do not write the results of this navigation to the disk cache.
navAllowAutosearch16If the navigation fails, the Web browser attempts to navigate common root domains (.com, .edu, and so on). If this still fails, the URL is passed to a search engine.
TargetFrameName is the name of the frame in which the resource will be displayed, or NULL if the resource should not be displayed in a named frame.
PostData contains the data sent to the server when using Navigate to generate an HTTP POST message. If PostData is NULL, Navigate generates an HTTP GET message. PostData is ignored if URL does not specify an HTTP URL.
Headers contains any headers sent to the servers when the URL represents an HTTP URL. HTTP headers specify such things as the intended action required of the server, the type of data, and so on. (See TWebRequest object, whose properties represent many of the more common headers).
Note:To navigate to a location that can抰 be expressed as an URL (for example, to an item identifier list), use the Navigate2 method instead.
设置flag为navOpenInNewWindow,不能用两个TCppWebBrowser打开,两个TCppWebBrowser,就相当于是两个新的IE,它们的Session是不能共享的
[解决办法]
w1中捕获NewWindow2,返回w2里面的浏览器接口
[解决办法]
学习!
楼上的两位高手怎么说的相反?