一段java下载的程序参考
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Properties;
public class Down {
/**
* @param args
*/
private static int downloaded; // number of bytes downloaded
private static final int MAX_BUFFER_SIZE = 1024;
private static int size; // size of download in bytes
public static void main(String[] args) throws Exception{
downloaded = 0;
size=0;
String url = "http://ime.sogou.com/dl/sogou_pinyin_42l.exe";
String proxy = "proxy.zte.com.cn";
String hosturl = url.substring(7, url.indexOf("/", 7));
String requesturl = url.substring(hosturl.length()+7);
//URL url1 = new URL(proxy + requesturl);
URL url1 = new URL(url);
HttpURLConnection connection =
(HttpURLConnection) url1.openConnection();
//connection.setRequest
相关问答:
通过java程序,先编译c程序,如出现错误,提示C程序中的错误,编译成功就运行,显示C的运行结果,最好把C的运行时间和内存等都显示出来
各位大哥大姐帮帮忙,小弟感激不尽!
用java的进程类试试
我给你转 ......
不知道是什么原因,我该如何处理,请大虾们指教了,小弟在此谢过。。。。
错误信息如下:
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context t ......
目前有一个java程序,调用存储过程在数据库中写入一些数据,然后将这些数据传输给另外一个程序,目前不管java连接成功或是不成功,该存储过程都会写入数据!
目前需要在java连接不成功的情况下,有何方法能使存储过程 ......
import java.io.*;
class FileTest
{
public static void main(String [] args) throws Exception
{
File fDir=new File(File.separator);
String strFile="java源代码测试"+File.separato ......
要求:
(1)本科或大专以上
(2)Java程序员(有一定的Java或Jsp开发经验)
(3)熟练掌握SQL语言、脚本语言javascript,动态网页jsp,静态网页html,CSS。
(4)熟悉SQL server 2k、Oracle或DB2或mySQL
( ......