Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common blocking methods of pop-up windows in ASP.NET

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

ASP.NET pop-up window common blocking methods, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

What are the common blocking methods of pop-up windows in ASP.NET?

Blocking of pop-up windows in ASP.NET 1. Blocking methods based on window titles

The principle of this blocking method is to check all the IE window titles regularly, and then compare them with the existing list (an array list maintained by the program). If there is the same, we close the window. Obviously, this approach has many flaws, it blocks all pop-up windows, controls too much, and is rarely used in the program. However, the deformation based on it is quite common. That is, the intelligent filtering technology based on the window title name, which blocks whether the title of the pop-up window contains keywords about advertising, which makes a good exploration to improve the filtering effect.

Pop-up window blocking in ASP.NET 2. Blocking method based on window class and location

After analysis, it is found that the class names of the normal browsing window are IEFRAME and CabinetWClass, while the class name of the advertising window is CabinetWClass. Further analysis shows that the value of rect.top of WorkerA class and Shell DocObject View class of advertising window is the same, while the value of rect.top of WorkerA class and Shell DocObject View class of normal IE window is different. According to the above two points, you can write the advertising killer program. In fact, I am skeptical about the versatility of this program. Because the author uses Spy++ analysis to find that in Windows2000 (the operating system used by the author), the class of IE window is IEFrame. At the same time, because Win2000 is an operating system based on Unicode code, there is no WorkerA class, and the WorkerW class takes its place. At the same time, there is no difference in rect.top, because the author does not have a WindowsXP operating system, so we can not make further experiments on WindowsXP.

Blocking of pop-up windows in ASP.NET 3. Blocking methods based on IE COM components

The above two ways are to treat the IE window as an ordinary Windows window to judge. In fact, IE is a typical browser based on COM components. All browsers based on IE kernel wrap shdocvw.dll files and then write the corresponding BHO code. Only in this way can you really control IE browsers, rather than scratching your boots like method one or two.

There is also a pop-up window blocking method based on IE kernel. It can be intercepted before the pop-up window opens. The principle is that every time IE opens a new window, it triggers the NewWindow event and executes the OnNewWindow2 ([out] IDispatch*, [out] BOOL * bCancel) method. Overload this method to determine whether the event of opening a new window occurs after the browsing page has been downloaded. If so, it is a normal pop-up window, otherwise it will be intercepted.

Since browsers like Gosurf overload Shocvm.dll components themselves, it makes sense to use the third approach. However, in the process of use, it is sometimes found that advertising filtering is not very *, but the principle is basically the same.

The common blocking methods of pop-up windows in ASP.NET are introduced to you here. I hope this introduction will be helpful to you.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report