Common blocking methods in ASP. NET pop-up window

Source: Internet
Author: User

In ASP. NET, what are common blocking methods in the pop-up window? Let's get started.

Pop-up window blocking in ASP. NET 1. window title-based blocking

The principle of this blocking method is to regularly check all the title of the IE window, and then compare the existing list with an array list maintained by the program. If there is the same list, we close the window. Obviously, this method has many defects. It blocks all the pop-up windows, and is too hard to manage. It is rarely used in the program. However, the deformation method based on it is quite common. That is, the smart Filtering Technology Based on the title name of the window, which blocks ads based on whether the title of the pop-up window contains keywords, which makes a good exploration to improve the filtering effect.

Pop-up window blocking in ASP. NET 2. Blocking Based on window classes and positions

After analysis, we found that the class names of the normal window are IEFRAME and CabinetWClass, while the class names of the window for advertisement are CabinetWClass. Further analysis shows that the WorkerA class of the AD window and the rect of the Shell DocObject View class are displayed. the top value is the same. The WorkerA class of the normal IE window and rect of the Shell DocObject View class. the top values are different. Based on the above two points, you can write the advertisement killer program. In fact, I am skeptical about the versatility of this program. The analysis using Spy ++ found that in Windows2000 (the operating system used by the author), the classes of IE Windows are IEFrame. At the same time, because Win2000 is an operating system based on Unicode Code, there is no WorkerA class, and it is replaced by the WorkerW class. At the same time, the rect. top is not the same. Because I do not have a Windows XP operating system, I cannot perform further experiments on Windows XP.

Pop-up window blocking in ASP. NET 3. Blocking Based on ie com components

Both of the above methods treat IE Windows as a normal Windows window and make judgments. In fact, IE is a typical COM-based browser. All IE-based browsers package the shdocvw. dll file and then write the corresponding BHO code. Only in this way can we truly control ie browsers, rather than the itching of methods 1 and 2.

There is also a pop-up window blocking method based on the IE kernel. It can be intercepted before the pop-up window is opened. The principle is that every time IE opens a new window, the NewWindow event is triggered, and the OnNewWindow2 ([out] IDispatch *, [out] BOOL * bCancel) method is executed. Reload this method to determine whether a new window event occurs after the page has been downloaded. If yes, it indicates a normal pop-up window, and vice versa.

As a browser like Gosurf itself reloads the Shocvm. dll component, the use of the third method naturally becomes a matter of course. However, during use, you may find that ad filtering is not perfect, but the principle is basically the same.

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

  1. Analysis of hidden risks of ASP. NET virtual hosts when creating data sources
  2. Meanings and benefits of ASP. NET stored procedure calls
  3. Analysis of ASP. NET application Resource Access Security Model
  4. Analysis of hidden risks of ASP. NET virtual hosts in displaying files
  5. ASP. NET host resource control experience

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.