脚本作用:持续ping该类服务器,保证中转路由能在业务使用时能够快速响应请求。
这是一个直接用 Java 自带的 API 实现的超轻量级的 HTTP 服务器,没有使用第三方类库 import java.io.IOException; import java.io.OutputStream;
分页显示服务器上指定目录下的所有图片代码 <%@ Page Language="C#" EnableViewState="false" %>
pb44
2015-05-02 2755 0
超级简单易用 可用于备份、下载、保存小型文件等功能。 <?file_put_contents("a.txt",file_get_contents("http://www.chinaz.com/program/2009/0913/91443.shtml"));?>
package com.hongyuan.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.HttpURLConnection; import java.net.U
#!/usr/bin/env python #-*-coding:utf-8-*-' #Filename:download_file.py import sys,os import urllib def urlcallback(a,b,c): """ call back function a,已下载的数据块 b,数据块的大小 c,远程文件的大小 """ print "callback" prec=
php通过socket post数据到其它web server function post_request($url, $data, $referer='') { // Convert the data array into URL Parameters like a=b&foo=bar etc. $data = http_build_query($data); // parse the give
using System; using System.IO; using System.Net; using System.Text; using System.Threading; class MainClass { private static int maxRequestHandlers = 5; private static int requestHandlerID = 0; privat
/* * WebServer.c * * Created on: Nov 3, 2012 * Author: pavithra * * A web server in C language using only the standard libraries. * The port number is passed as an argument. * */ #include <stdio.h> #i
public class MultithreadJIoSocketTest { @Test public void testMultithreadJIoSocket() throws Exception { ServerSocket serverSocket = new ServerSocket (10002); Thread thread = new Thread (new Accptor (s
import urllib2 # Install proxy support for urllib2 proxy_info = { 'host' : 'proxy.myisp.com', 'port' : 3128, } proxy_support = urllib2.ProxyHandler({"ftp" : "http://%(host)s:%(port)d" % proxy_info}) o
/** C# Programming Tips & Techniques by Charles Wright, Kris Jamsa Publisher: Osborne/McGraw-Hill (December 28, 2001) ISBN: 0072193794 */ // Proxy.cs -- Implements a multi-threaded Web proxy server //
package main import ( "net/http" "regexp" ) func main() { http.HandleFunc("/", route) http.ListenAndServe(":8080", nil) } var num = regexp.MustCompile(`\d`) var str = regexp.MustCompile(`\w`) func rou
#!/bin/sh if [ $# -lt 1 ]; then echo "[FAILED]please input project name." else if [ -d /home/admin/work/$1 ]; then cd /home/admin/work/$1 svn up > files find -name "files" -exec grep ".vm" {} \;|while
public static File downLoad(String serverPath,String savedPath,ProgressDialog dialog){ try { URL url=new URL(serverPath); HttpURLConnection _conn=(HttpURLConnection) url.openConnection(); _conn.setReq
public static File downLoad(String serverPath,String savedPath,ProgressDialog dialog){ try { URL url=new URL(serverPath); HttpURLConnection _conn=(HttpURLConnection) url.openConnection(); _conn.setReq
[Java]代码 /** * 获取登录用户IP地址 * * @param request * @return */ public static String getIpAddr(HttpServletRequest request) { String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() =
// FTP access parameters $host = 'ftp.example.org'; $usr = 'example_user'; $pwd = 'example_password'; // file to move: $local_file = './example.txt'; $ftp_path = '/data/example.txt'; // connect to FTP
//RunningServicesInfo public static String getRunningServicesInfo(Context context) { StringBuffer serviceInfo = new StringBuffer(); final ActivityManager activityManager = (ActivityManager) context .g
[operationManager.reachabilityManager startMonitoring]; } //服务端 #import