java 取文件更新使劲,Java 在线更新程序(通过数据库获取更新文件)

/*先把下载的文件放在UpdateTemp文件夹中,待全部下载后,再把此文件夹中的文件移出替换旧文件*/

import java.awt.Color;

import java.awt.Dimension;

import java.awt.Toolkit;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.util.Vector;

import java.util.logging.Level;

import java.util.logging.Logger;

import javax.swing.JOptionPane;

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

/*

* Main.java

*

* Created on 2009-7-9, 22:29:27

*/

/**

*

* @author Administrator

*/

public class Main extends javax.swing.JFrame {

Connection cn=null;

MSConnection con=new MSConnection();

File file=null;

Vector vtFileName=new Vector();

int Process=0;

/** Creates new form Main */

public Main() {

initComponents();

this.setTitle("在线更新程序");

this.setVisible(true);

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); //得到屏幕的尺寸

this.setLocation((screenSize.width)/2-150, (screenSize.height)/2-200);

// try {

// Thread.currentThread().sleep(10000);

// } catch (InterruptedException ex) {

// Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);

// }

}

public void RunProgram(){

// String path=System.getProperty("user.dir"); //获取路径

try {

String OS = System.getProperty("os.name"); //获取当前操作系统,Windows or Linux

// String path=System.getProperty("user.dir"); //获

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值