Obtain the content of the target webpage.

Source: Internet
Author: User

Obtain the content of the target webpage.

1 HttpWebRequest request = WebRequest. Create (" http://www.baidu.com/ ") As HttpWebRequest; 2 HttpWebResponse response = request. getResponse () as HttpWebResponse; 3 4 if (response. statusCode = HttpStatusCode. OK) 5 {6 string characterSet = response. characterSet; 7 Encoding encode; 8 if (characterSet! = "") 9 {10 encode = Encoding. getEncoding (characterSet); 11} 12 else13 {14 encode = Encoding. default; 15} 16 17 Stream receiveStream = response. getResponseStream (); 18 StreamReader reader = new StreamReader (receiveStream, encode); 19 char [] read = new char [255]; 20 // read 25521 int count = reader each time. read (read, 0,255); 22 string str = string. empty; 23 while (count> 0) 24 {// if you read a certain number of strings, enter these strings into the string 25 str + = new String (read, 0, count); 26 count = reader. read (read, 0,255); // Read the following 255 content 27} 28 webBrowser1.DocumentText = str; 29 30 // read 31 reader. close (); 32 receiveStream. close ();

 


PHP: Obtain the source code of the target webpage. 1. Use the fsockopen function.
2. Regular Expressions match webpage content
3. Want to improve self-Writing
How can I extract the answers under the webpage text to help me find them online!
Attackers can copy webpages.
★You can use the IE Browser file drop-down menu to send an email page to copy the email page to achieve the download
★2. You can copy and download the copy webpage address by using the IE Browser Editor and other software editing states to open Microsoft Office WORD, click "File". In the displayed dialog box, enter the address of the copied webpage or press ctrl + v to open the webpage. The Word is not enough memory. This operation cannot be undone. Do you want to continue? in the prompt window, click to bring up a new window asking whether to trust the file source and then clicking Word will automatically link to the corresponding server and open the webpage, we select the text to copy and paste it. In addition, WPS2005 also uses this method very well. easy sample copying and cutting as you wish
★3. Use IE browser to view the source file function. In the pop-up window of the menu, you can find that the content to be copied and downloaded is not formatted. In addition, you can use Firefox, a browser with special features, to implement functions that can be implemented by IE browser. other control script operations disabled by the browser (examples): click "option"-"Download control"-check and copy back before allowing scripts. You can also remove the Allow java and allow activex check.
★4. Change the security-level cracking method: click IE browser tool-internet option-Security its internet security level is set to high level OK refresh web page that is, when the security level is high, both the control and script can run, and then the powerful web page restriction means are all voided! Or click the Custom Level button next to the Security tab. In the pop-up window, all scripts are disabled. If you press F5 to refresh the page, you can copy and paste the webpage content. When you collect the required content, you can use the same content. the steps to unban the webpage script will affect our Webpage Browsing.
★5. Let's take a look at what can be copied.
At present, many web page makers want to allow their webpage content to be directly copied with copyright, and let people look back at the text segment to increase the access volume, and so on. The specific reasons are also clear. add webpage code or multiple codes:
Onpaste = "return false" quasi-paste
Oncopy = "return false;" quasi-copy
Oncut = "return false;" prevents Cropping
Onselectstart = "return false" quasi-selection
For example, let's select a copy statement. Now we know that the statement can be copied. We have chosen the right medicine for some code.
Step 1: Open the website you want to copy
Step 2: Save the webpage to another computer (File | save another | XXX.html)
Step 3: use NotePad to open the code for saving the webpage segment (set to the exact sample) and delete all the code (except the body) in it.
Step 4: Double-click to open the saved web page, and click the mouse to select and copy the desired text.
★6. Familiar with the above methods. You can also use another method: file-save-txt text document open the saved text document. If you want to copy and copy the file, only the valid text information will be lost.
Sometimes you can still copy or download objects using the above methods. I would like to remind you that there is another trick: Searching for webpage snapshots of relevant titles. Currently, Baidu, GOOGLE, and other search engines have the Web snapshot function. A good way to copy and download
Certificate -------------------------------------------------------------------------------------------------------------------------------------
Blocking right-click cracking
★1. Copyright Information
Solution: when you right-click a page target, the right-click window is displayed. When you right-click the page and choose "Move Pointer" from the window, click the left-click button, and the left-click window is closed. Then, the right-click the target is removed.
★2. Add favorites
Solution: right-click the target, right-click the target, and the right-click is displayed. When the right-click the target, the right-click the target, and the right-click the target to be added to the favorites window, and the right-click the button to move the cursor, and press the Space key. move the mouse and click the left button.
★3. You cannot right-click a hyperlink to open a menu in a new window.
Method of cracking: the above two methods cannot be used to crack the attack: click the upper-right corner of the hyperlink. In the pop-up window, you need to release the right-click button. When the Space key window on the keyboard disappears, open the right-click menu and select its new window.
★4. the browser clicks to view the source file command sample on the menu to see the html source code. After the web page is used, the framework can only see the framework Page code. This method works. Press Shift + F10 on the keyboard to try the combination.
★5. You can see the right Ctrl key on the keyboard and the left key. Press the right-click button and the menu appears.
★6. Right-click the screen, right-click the page, right-click the page, and a restricted window appears. At this time, you need to release the right-click and press ALT + F4 on the left-hand keyboard. The window is closed, and the right-click menu appears.
Certificate -------------------------------------------------------------------------------------------------------------------------------------
How to disable right-click on a webpage
When we access the Internet, we often find that the right-click button is disabled, but some content is very popular. If we want to save texts or illustrations locally, we can see what we should do to crack the restrictions? I will give you a solution based on the same situation, and hope it will be useful to you.
  
★Situation: text cannot be copied on a webpage and Images cannot be downloaded using another method of saving images
Solution: Right-click Properties in IE browser-Disable activity scripts and Java Applet scripts at the custom security level.
★Case 2: Right-click the page target and the restriction window is displayed, prompting you to disable right-click.
Solution: on the page target, right-click the page, right-click the page, move the mouse cursor, and click OK. At the same time, the left mouse button is removed. The Restricted window is closed. move the cursor to the target, and the right-click menu is displayed.
★Case 3: Right-click the target and the "add favorites" window appears.
Solution: Right-click the target, right-click the target, or move the mouse. At this time, use the Tab key to move the cursor. When the Space key is pressed, the window is closed.
★Case 4: You cannot right-click a hyperlink to open a menu in a new window.
The above two methods cannot be used to crack the attack: click the upper-right corner of the hyperlink. In the pop-up window, you need to release the right-click button. When the Space key window on the keyboard disappears, open the right-click menu and select its new window.
★Case 5: Right-click is invalid and no response is made.
Solution:
1) Right-click the lock and press the [Alt] key.
2) press the [F12] key again.
3) Right-click anywhere!
★Case 6: key combinations
1. How can I try Shift + F10 on the keyboard? Wow! Right-click the menu!
2. Another trick: Can I see the left Key of the right Ctrl key on the keyboard? Shortcut menu key pulling! Right-click the menu and the page appears! Or you want to right-click the place and press the left mouse button, and then press the shortcut menu key on the keyboard.
3. Drag and hold the WIN + D key to save the image! (This method is suitable for single-handed users with more flexible operations)
4. Right-click the screen, right-click the page, right-click the page, and a restricted window appears. At this time, you need to release the right-click and press ALT + F4 on the left-hand keyboard. The window is closed, and the right-click menu is displayed! The attack can be easily cracked in all situations!
★Case 7: Java script source code modification
Sometimes, when you browse a webpage, All Rights Reserved (C) appear in any form of Mouse clicking or combination clicking except by clicking the left mouse button. Copying is prohibited! The prompt box adds the following code to the webpage file:
In the address bar, type: java script: alert (document. oncontextmenu = ''') and press enter to confirm that you can right-click the box!

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.