Heim Backend-Entwicklung C#.Net-Tutorial HttpClient crawlt den Quellcode von Webseiten

HttpClient crawlt den Quellcode von Webseiten

Dec 20, 2016 pm 12:00 PM
apache

Paket UTIL;

import java.io.IOException;

import java.io 🎜>import java.text.DateFormat;
import java.util.ArrayList;
import java.util.HashMap; 🎜>import java.util.List;
import java.util.Set;
import java.util.zip .GZIPInputStream;

import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair ; httpclient.SimpleHttpConnectionManager;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params. HttpConnectionManagerParams;

import org.apache.commons.httpclient.params.HttpMethodParams;

/ **
* @author Liuwei
* Datum: 18. Dezember 2009
*
* TODO
* Hilfsklasse für HttpClient
* /
öffentliche Klasse HttpClientHelper
{

/ **
* Zeitüberschreitung der HttpClient-Verbindung, Zeitüberschreitungseinstellung für das Lesen von Daten (Einheit: Millisekunden)
* /
Öffentliche statische endgültige Interpretation HTTPCLIENT_CONNECTION_TIMEOUT = 30000;
Public static final int HTTPCLIENT_SO_TIMEOUT = 120000;
Public static final int HTTPMETHOD_SO_TIMEOUT = 5000;

//Lassen Sie den ConnectionManager verwalten, ob die Verbindung geschlossen werden soll
Private static boolean AlwaysClose = FALSE ;
private static string defaultEncode = "UTF-8"; private static last DateFormat DATE_FORMAT = new SimpleDateFormat("YYYY-MM-DD HH:MM:SS");

/ **
* Holen Sie sich die HttpClient-Verbindung und legen Sie die relevanten Parameter fest
*
* @return
* /
Public static HttpClient's getHttpClient()
{
HttpClient client = new HttpClient(new SimpleHttpConnectionManager(alwaysClose));
HttpConnectionManagerParams managerParams = client.getHttpConnectionManager() getParams() Methode.
//Legen Sie das Zeitlimit für die Verbindung fest (in Millisekunden)
managerParams.setConnectionTimeout (HTTPCLIENT_CONNECTION_TIMEOUT);
//Legen Sie das Zeitlimit für das Lesen von Daten fest (in Millisekunden)
managerParams.setSoTimeout (HTTPCLIENT_SO_TIMEOUT);
Zurück zum Client;
}

/ **
* Holen Sie sich die HttpClient-Verbindung und legen Sie die relevanten Parameter fest
*
* @parameter logonSite
* @parameter logonPort
* @parameter Protocol
* @return
* /
public static HttpClient getHttpClient(last string logonSite, last int logonPort, last string Protocol)
{
HttpClient client = new HttpClient( new SimpleHttpConnectionManager(alwaysClose));
client.getHostConfiguration() setHost(logonSite, logonPort, Protocol).
HttpConnectionManagerParams managerParams = client.getHttpConnectionManager() getParams()-Methode.
//Legen Sie das Zeitlimit für die Verbindung fest (in Millisekunden)
managerParams.setConnectionTimeout (HTTPCLIENT_CONNECTION_TIMEOUT);
//Legen Sie das Zeitlimit für das Lesen von Daten fest (in Millisekunden)
managerParams.setSoTimeout (HTTPCLIENT_SO_TIMEOUT);
return client; ;
boolean includeUserAgent = FALSE;
if (null = header&& false == header.isEmpty()!)
{
set> );
for (enter Eintrag: EntrySet)
{
if (false == includeUserAgent
&&"UserAgent".equals(entry.getKey()))
{
includeUserAgent = TRUE;
}
headers.add(new headers(entry.getKey(), enter.getValue())); >if (false == includeUserAgent)
{
headers.add(new headers(
"UserAgent" ,
"Mozilla/4.0 (Kompatibel mit; MSIE 7.0; Windows NT 5.1; GTB5; . NET CLR 1.1.4322; .NET CLR 2.0 0.50727; MAXTHON 2.0)); ;String, String> POSTDATA)
{
if (null == || POSTDATA postData.isEmpty())
{
return NULL; ;input> = EntrySet postData.entrySet(); 🎜>For (enter enter :entrySet)
{
double[i++] = new NameValuePair(entry.getKey(), enter.getValue()}
Rückgabepaar;
}

/ **
*Inhaltsinformationen der Webseite anfordern
*
* @parameter HttpClient
* @parameter reqUrl
*Parametertitel
* @parameter POSTDATA
*Parameterkodierung
* @return
*/
Öffentliche statische Zeichenfolge doRequest(HttpClient HttpClient, String reqUrl,
Map header, Map< String, String> POSTDATA, String-Kodierung)
{
String htmlContent = NULL;if (null == HttpClient)
{
return htmlContent; >//Codierungseinstellungen anfordern
Encoding = (empty == binding defaultEncode: binding);//Header-Anforderungsinformationen
List = header getHeaders (head); 🎜>System.out.println("[" + DATE_FORMAT.format(new Date()) + "] - doRequest - " + reqUrl>//Exchange method <br> if (empty = POSTDATA! ) <br>{ <br> PostMethod PostMethod = new EncodePostMethod(reqUrl,kodierung); <br> for (head tempHeader: header) <br>{ <br>postMethod.setRequestHeader(tempHeader); 🎜>//Post-Parameter-Einstellung NameValuePair [] of <br> = PARAMS getPairs(POSTDATA);if (leer = Parameter!) <br>{ <br>postMethod.setRequestBody(PARAMS); <br>} <br><br>//Webseiteninhalt extrahieren <br>htmlContent =executeMethod(HttpClient, post-method,kodierung, getWebSite(reqUrl)); neue Implementierung getMethod(reqUrl); <br>for (head tempHeader: header) <br>{ <br>getMethod.setRequestHeader(tempHeader); <br>} <br><br>//Webseiteninhalt extrahieren <br> htmlContent =executeMethod(HttpClient, getMethod,kodierung, NULL); <br>} <br>return htmlContent; <br>} <br><br>Private static String getWebSite(String reqUrl) <br>{ <br>String website = NULL; <br>if (null == reqUrl || reqUrl.isEmpty()) <br>{ <br>Return website; <br>if (reqUrl.startsWith(prefix)) <br>{ <br>INT index = reqUrl.substring(prefix.length()) indexOf("/") + prefix .length(); <br>Website = reqUrl.substring(0, index); <br>} <br>Return to website; >* @parameter HttpClient <br>* @parameter requestMethod <br>*parameterkodierung <br>*parameter website <br>* @return <br>* / <br>Privater statischer StringexecuteMethod(HttpClient HttpClient, enum HTTPMethod requestMethod, codierter String, String-Site) <br>{ <br>String ResponseContent = NULL; <br>if (null == HttpClient) <br>{ <br>Return ResponseContent; Bestimmen Sie, ob verschlüsselte Daten angefordert werden sollen <br> Boolean dataEncrypt = FALSE; <br>Header takeEncoding = requestMethod.getRequestHeader ("Accept Encoding"); leer = AcceptEncoding <br>. && AcceptEncoding.getValue() enthält("gzip")) <br>{ <br>dataEncrypt = TRUE <br>} <br><br>InputStream ResponseStream = NULL <br>try<br>{ <br> INT status = httpClient.executeMethod(requestMethod); <br>if (HttpStatus.SC_OK == status) <br>{ <br>responseStream = requestMethod.getResponseBodyAsStream(); <br>responseContent = getContentByStream(dataEncrypt new GZIPInputStream( ResponseStream) : ResponseStream, Encoding); . Dies ist bei einigen Anmeldungen nicht der Fall. Wichtig bei der Autorisierung der Verwendung von Cookies <br> Andernfalls gilt, wenn (HttpStatus.SC_MOVED_PERMANENTLY == Status <br>|| = Status <br>||. HttpStatus.SC_TEMPORARY_REDIRECT = = Status) <br>{ <br>//Neue URL-Adresse lesen <br>Header = requestMethod.getResponseHeader("position"); <br>if (! header = NULL ) <br> if (empty == RedirectUrl || RedirectUrl.isEmpty()) <br>{ <br>redirectUrl = "/"; <br>} <br><br> if (false == RedirectUrl.startsWith(" HTTP: //") <br>! && empty = website) <br>{ <br>if (website.startsWith("/")) <br>{ <br>redirectUrl = website+redirectUrl; <br>} <br>Andere<br>{ <br>redirectUrl = website + "/" + restartUrl; <br>} <br><br>GetMethod weitergeleitet = neue Implementierung getMethod(redirectUrl); = requestMethod.getRequestHeader("referrer"); <br>if (null = referrer! ) <br>{ <br>redirect.addRequestHeader(referrer); <br>} <br> header cookie = requestMethod.getRequestHeader("cookie"); <br>if (null = cookie!) <br>{ <br>redirect.addRequestHeader(cookie); <br>status = httpClient.executeMethod(redirect); <br>if (HttpStatus.SC_OK == status) <br>{ <br>responseStream = getResponseBodyAsStream(). ; <br>responseContent = getContentByStream(responseStream(); } //Endstatus <br><br>} Catch Up (Exception 5) <br>{ <br>e.printStackTrace (); <br>}Endlich <br>{ <br>if (requestMethod!= NULL) <br>{ <br>requestMethod.releaseConnection(); <br>} <br>} <br>return ResponseContent; <br><br>/ ** <br> *Informationen aus dem Stream gemäß der angegebenen Kodierung lesen <br>* <br>* @Parameter inStream <br>*Parameterkodierung <br>* @Return <br>* IOException auslösen <br>* / <br>Public static String getContentByStream(InputStream inStream, String-Kodierung) löst eine IOException aus <br>{ <br>if (null == instream) <br>{ <br>return NULL <br>} <br><br>Content of StringBuilder = new StringBuilder(); <br>//Lesen Sie den Stream-Inhalt mit dem angegebenen Codierungsformat <br> BufferedReader reader = new BufferedReader(new InputStreamReader(Interstitial, binding)); <br> String message = NULL; while (null = (message = reader.readLine())!) <br>{ <br>content.append(message); <br>content.append("r n"} <br>//Schließen Sie den Reader und Ressourcen freigeben <br>reader.close(); <br>Return (content.toString()); <br><br>/ ** <br>* Innere Klasse, geerbt von PostMethod, früher Geben Sie das Codierungsformat der Postanforderung an >{ <br>Super(URL); <br>this.encode = binding; generate method stub <br> return (this.encode); <br>} <br><br>} <br><br>/ * * <br>*Test<br>* <br>* @parameter ARGS <br>* / <br>public static void main(String[] args)<br>{ <br>//System.setProperty( "http.proxyHost", "165.228.128.10"); <br>//System. setProperty("http.proxyPort", "3128"); <br>//System.setProperty("http.proxySet", "true "); <br><br><br>String reqUrl = " http:// news.39.net/jbyw/index.html "; <br>reqUrl = " http://news.39.net/ a/2010722/1404231.html "; <br>Map<String, String> headers = neu HashMap <String, String>(); <br>headers.put("Akzeptiere die Codierung", "gzip,deflate"); HttpClient, reqUrl, headers, null, "GBK"); <br> System.out.println(htmlContent); <br><br>} <br></p> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">Erklärung dieser Website</div> <div>Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Heißer Artikel</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796780570.html" title="R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796780641.html" title="R.E.P.O. Beste grafische Einstellungen" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Beste grafische Einstellungen</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle -Lösung" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle -Lösung</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796789525.html" title="Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben" class="phpgenera_Details_mainR4_bottom_title">Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796780618.html" title="Will R.E.P.O. Crossplay haben?" class="phpgenera_Details_mainR4_bottom_title">Will R.E.P.O. Crossplay haben?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/article.html">Mehr anzeigen</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>Heiße KI -Werkzeuge</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>KI-gestützte App zum Erstellen realistischer Aktfotos</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>Online-KI-Tool zum Entfernen von Kleidung aus Fotos.</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>Ausziehbilder kostenlos</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>KI-Kleiderentferner</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>Erstellen Sie kostenlos Ai Hentai.</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/ai">Mehr anzeigen</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Heißer Artikel</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796780570.html" title="R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796780641.html" title="R.E.P.O. Beste grafische Einstellungen" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Beste grafische Einstellungen</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle -Lösung" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle -Lösung</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796789525.html" title="Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben" class="phpgenera_Details_mainR4_bottom_title">Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796780618.html" title="Will R.E.P.O. Crossplay haben?" class="phpgenera_Details_mainR4_bottom_title">Will R.E.P.O. Crossplay haben?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/article.html">Mehr anzeigen</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>Heiße Werkzeuge</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Notepad++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_title"> <h3>Notepad++7.3.1</h3> </a> <p>Einfach zu bedienender und kostenloser Code-Editor</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/93" title="SublimeText3 chinesische Version" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 chinesische Version" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/93" title="SublimeText3 chinesische Version" class="phpmain_tab2_mids_title"> <h3>SublimeText3 chinesische Version</h3> </a> <p>Chinesische Version, sehr einfach zu bedienen</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/121" title="Senden Sie Studio 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Senden Sie Studio 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/121" title="Senden Sie Studio 13.0.1" class="phpmain_tab2_mids_title"> <h3>Senden Sie Studio 13.0.1</h3> </a> <p>Leistungsstarke integrierte PHP-Entwicklungsumgebung</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title"> <h3>Dreamweaver CS6</h3> </a> <p>Visuelle Webentwicklungstools</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/500" title="SublimeText3 Mac-Version" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac-Version" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/500" title="SublimeText3 Mac-Version" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac-Version</h3> </a> <p>Codebearbeitungssoftware auf Gottesniveau (SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/ai">Mehr anzeigen</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Heiße Themen</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/gmailyxdlrkzn" title="Wo ist der Login-Zugang für Gmail-E-Mail?" class="phpgenera_Details_mainR4_bottom_title">Wo ist der Login-Zugang für Gmail-E-Mail?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7555</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/cakephp-tutor" title="CakePHP-Tutorial" class="phpgenera_Details_mainR4_bottom_title">CakePHP-Tutorial</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1383</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/steamdzhmcssmgs" title="Wie lautet das Format des Kontonamens von Steam?" class="phpgenera_Details_mainR4_bottom_title">Wie lautet das Format des Kontonamens von Steam?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>83</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/winactivationkeyper" title="Win11 -Aktivierungsschlüssel dauerhaft" class="phpgenera_Details_mainR4_bottom_title">Win11 -Aktivierungsschlüssel dauerhaft</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>59</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/newyorktimesdailybrief" title="NYT -Verbindungen Hinweise und Antworten" class="phpgenera_Details_mainR4_bottom_title">NYT -Verbindungen Hinweise und Antworten</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>28</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>96</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/faq/zt">Mehr anzeigen</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796791637.html" title="So führen Sie das H5 -Projekt aus" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202406/03/2024060318422060666.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So führen Sie das H5 -Projekt aus" /> </a> <a href="https://www.php.cn/de/faq/1796791637.html" title="So führen Sie das H5 -Projekt aus" class="phphistorical_Version2_mids_title">So führen Sie das H5 -Projekt aus</a> <span class="Articlelist_txts_time">Apr 06, 2025 pm 12:21 PM</span> <p class="Articlelist_txts_p">Ausführen des H5 -Projekts erfordert die folgenden Schritte: Installation der erforderlichen Tools wie Webserver, Node.js, Entwicklungstools usw. Erstellen Sie eine Entwicklungsumgebung, erstellen Sie Projektordner, initialisieren Sie Projekte und schreiben Sie Code. Starten Sie den Entwicklungsserver und führen Sie den Befehl mit der Befehlszeile aus. Vorschau des Projekts in Ihrem Browser und geben Sie die Entwicklungsserver -URL ein. Veröffentlichen Sie Projekte, optimieren Sie Code, stellen Sie Projekte bereit und richten Sie die Webserverkonfiguration ein.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796792206.html" title="So setzen Sie die Charaktercodierung auf der Serverseite, um die Bootstrap -Tabelle zu lösen" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202412/17/2024121709242220948.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So setzen Sie die Charaktercodierung auf der Serverseite, um die Bootstrap -Tabelle zu lösen" /> </a> <a href="https://www.php.cn/de/faq/1796792206.html" title="So setzen Sie die Charaktercodierung auf der Serverseite, um die Bootstrap -Tabelle zu lösen" class="phphistorical_Version2_mids_title">So setzen Sie die Charaktercodierung auf der Serverseite, um die Bootstrap -Tabelle zu lösen</a> <span class="Articlelist_txts_time">Apr 07, 2025 pm 12:00 PM</span> <p class="Articlelist_txts_p">Um die Charaktercodierung auf der Serverseite festzulegen, um die durchgestellte Bootstrap -Tabelle zu lösen, müssen Sie die folgenden Schritte ausführen: Überprüfen Sie die Server -Zeichencodierung. Bearbeiten Sie die Serverkonfigurationsdatei; Setzen Sie die Zeichenkodierung auf UTF-8; Speichern und starten Sie den Server neu; Überprüfen Sie die Codierung.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796795577.html" title="So setzen Sie das CGI -Verzeichnis in Apache" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202405/29/2024052917481770322.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So setzen Sie das CGI -Verzeichnis in Apache" /> </a> <a href="https://www.php.cn/de/faq/1796795577.html" title="So setzen Sie das CGI -Verzeichnis in Apache" class="phphistorical_Version2_mids_title">So setzen Sie das CGI -Verzeichnis in Apache</a> <span class="Articlelist_txts_time">Apr 13, 2025 pm 01:18 PM</span> <p class="Articlelist_txts_p">Um ein CGI-Verzeichnis in Apache einzurichten, müssen Sie die folgenden Schritte ausführen: Erstellen Sie ein CGI-Verzeichnis wie "CGI-bin" und geben Sie Apache-Schreibberechtigungen. Fügen Sie den Block "scriptalias" -Richtungsblock in die Apache-Konfigurationsdatei hinzu, um das CGI-Verzeichnis der URL "/cgi-bin" zuzuordnen. Starten Sie Apache neu.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796795573.html" title="So starten Sie Apache" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202406/03/2024060318514590029.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So starten Sie Apache" /> </a> <a href="https://www.php.cn/de/faq/1796795573.html" title="So starten Sie Apache" class="phphistorical_Version2_mids_title">So starten Sie Apache</a> <span class="Articlelist_txts_time">Apr 13, 2025 pm 01:06 PM</span> <p class="Articlelist_txts_p">Die Schritte zum Starten von Apache sind wie folgt: Installieren Sie Apache (Befehl: sudo apt-Get-Get-Installieren Sie Apache2 oder laden Sie ihn von der offiziellen Website herunter). (Optional, Linux: sudo systemctl</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796795168.html" title="So überprüfen Sie die Debian OpenSSL -Konfiguration" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/221/864/174295392476005.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So überprüfen Sie die Debian OpenSSL -Konfiguration" /> </a> <a href="https://www.php.cn/de/faq/1796795168.html" title="So überprüfen Sie die Debian OpenSSL -Konfiguration" class="phphistorical_Version2_mids_title">So überprüfen Sie die Debian OpenSSL -Konfiguration</a> <span class="Articlelist_txts_time">Apr 12, 2025 pm 11:57 PM</span> <p class="Articlelist_txts_p">In diesem Artikel werden verschiedene Methoden eingeführt, um die OpenSSL -Konfiguration des Debian -Systems zu überprüfen, um den Sicherheitsstatus des Systems schnell zu erfassen. 1. Bestätigen Sie zuerst die OpenSSL -Version und stellen Sie sicher, ob OpenSSL installiert wurde und Versionsinformationen. Geben Sie den folgenden Befehl in das Terminal ein: Wenn OpenSslversion nicht installiert ist, fordert das System einen Fehler auf. 2. Zeigen Sie die Konfigurationsdatei an. Die Hauptkonfigurationsdatei von OpenSSL befindet sich normalerweise in /etc/ssl/opensl.cnf. Sie können einen Texteditor (z. B. Nano) verwenden: Sudonano/etc/ssl/openSSL.cnf Diese Datei enthält wichtige Konfigurationsinformationen wie Schlüssel-, Zertifikatpfad- und Verschlüsselungsalgorithmus. 3.. Verwenden Sie OPE</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796795161.html" title="So verwenden Sie Debian Apache -Protokolle, um die Website der Website zu verbessern" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/221/864/174297507349561.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So verwenden Sie Debian Apache -Protokolle, um die Website der Website zu verbessern" /> </a> <a href="https://www.php.cn/de/faq/1796795161.html" title="So verwenden Sie Debian Apache -Protokolle, um die Website der Website zu verbessern" class="phphistorical_Version2_mids_title">So verwenden Sie Debian Apache -Protokolle, um die Website der Website zu verbessern</a> <span class="Articlelist_txts_time">Apr 12, 2025 pm 11:36 PM</span> <p class="Articlelist_txts_p">In diesem Artikel wird erläutert, wie die Leistung der Website verbessert wird, indem Apache -Protokolle im Debian -System analysiert werden. 1. Log -Analyse -Basics Apache Protokoll Datensätze Die detaillierten Informationen aller HTTP -Anforderungen, einschließlich IP -Adresse, Zeitstempel, URL, HTTP -Methode und Antwortcode. In Debian -Systemen befinden sich diese Protokolle normalerweise in /var/log/apache2/access.log und /var/log/apache2/error.log verzeichnis. Das Verständnis der Protokollstruktur ist der erste Schritt in der effektiven Analyse. 2. Tool mit Protokollanalyse Mit einer Vielzahl von Tools können Apache -Protokolle analysiert: Befehlszeilen -Tools: GREP, AWK, SED und andere Befehlszeilen -Tools.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796795574.html" title="So löschen Sie mehr als Servernamen von Apache" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202405/29/2024052918003190426.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So löschen Sie mehr als Servernamen von Apache" /> </a> <a href="https://www.php.cn/de/faq/1796795574.html" title="So löschen Sie mehr als Servernamen von Apache" class="phphistorical_Version2_mids_title">So löschen Sie mehr als Servernamen von Apache</a> <span class="Articlelist_txts_time">Apr 13, 2025 pm 01:09 PM</span> <p class="Articlelist_txts_p">Um eine zusätzliche Servername -Anweisung von Apache zu löschen, können Sie die folgenden Schritte ausführen: Identifizieren und löschen Sie die zusätzliche Servername -Richtlinie. Starten Sie Apache neu, damit die Änderungen wirksam werden. Überprüfen Sie die Konfigurationsdatei, um Änderungen zu überprüfen. Testen Sie den Server, um sicherzustellen, dass das Problem behoben ist.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796795576.html" title="So sehen Sie Ihre Apache -Version an" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202405/29/2024052917511487506.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So sehen Sie Ihre Apache -Version an" /> </a> <a href="https://www.php.cn/de/faq/1796795576.html" title="So sehen Sie Ihre Apache -Version an" class="phphistorical_Version2_mids_title">So sehen Sie Ihre Apache -Version an</a> <span class="Articlelist_txts_time">Apr 13, 2025 pm 01:15 PM</span> <p class="Articlelist_txts_p">Es gibt 3 Möglichkeiten, die Version auf dem Apache -Server anzuzeigen: Über die Befehlszeile (apachect -v- oder apache2CTL -v) überprüfen Sie die Seite Serverstatus (http: // & lt; Server -IP- oder Domänenname & GT;/Server -Status) oder die Apache -Konfigurationsdatei (Serversion: Apache/& lt; Versionsnummer & GT;).).</p> </div> </div> <a href="https://www.php.cn/de/be/" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!</p> </div> <div class="footermid"> <a href="https://www.php.cn/de/about/us.html">Über uns</a> <a href="https://www.php.cn/de/about/disclaimer.html">Haftungsausschluss</a> <a href="https://www.php.cn/de/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1744965299"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>