基于Java的远程桌面监控源代码来源: 熊哲的日志import java. io. *;import java, awt ・ Choice;import java. awt. Dialog;import java. awt. FlowLayout;import java. awt. BorderLayout;import java. awt. Font;import java. awt. Color;import java.net. Socket;import java.net. InetAddress;import javax. swing. *;import java. awt. event. ActionListener;import java. awt. event. ActionEvcnt;import java. awt. event. WindowAdapter;import java. awt. event. WindowEvent;import java. awt. event. KeyAdapter;import java. awt. event. KeyEvent;import javax. swing, tree. DcfaultMutablcTrceNodc;import javax. swing, tree. DefaultTreeCellRenderer;
import javax. swing, tree. DefaultTreeModel;import javax. swing, tree. TreePath;import javax. swing, tree. TreeNode;import java. awt. Image;import javax. swing. Imagelcon;import java. awt. Toolkit;public class midClient
{public static void main(String[] args) throws IOException
{try {
UIManagcr. sctLookAndFccl ("com. sun. jav a.swing, plaf. windows. WindowsLookAndFeeT7) ;
}catch(Exception el) {}new Ctree () ;class Ctree extends JFrame implements ActionListener
{boolean disConncct=false;boolean passOk=true;boolean startPort=false;
boolean DialogApp=false;boolean existFile;
FileOutputStream fo;
//KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL*KL* If/ I
JMenuBar menu二new JMenuBar ;
JMcnu mnuFile =ncw JMenu z文件“
JMcnuItcm AddComputcr =ncw JMcnu It cm z添加新主机〃
JMenuItem mnuFileExit =new JMenultem 〃退岀〃 ;
/ / •9
II /
JButton Addcomputer二new JButton z隐藏主机“
JLabel Ilost=new JLabel 〃选择主机〃 ;
JPancl H A=ncw JPanel ;
Choice Address=new Choice ;
JLabel Connectlp=new JLabel 〃服务器IP地址“
JTextField ConnectTpText=new JTextField 14 ;
DcfaultMutablcTrccNodc Root二new DcfaultMutablcTrccNodc z远程控制管理器〃
JTree tree二new JTree Root ; ;
JPopupMenu popM二new JPopupMenu ;
JMenuItem cy_load二new JMenuItem 〃下载"
JMcnuItcm cy delcct=ncw JMenuItem 删除〃 ;
JMenuItem cy_refurbish=new JMenultem 〃刷新子项〃 ;
JFileChooser Jsave二new JFileChooser ;
JScrolIPane treePane=new JScrolIPane ;
DefaultTreeCel1 Renderer cel 1 Renderer二nul1;
DefaultMutableTreeNode nodel二null;
DefaultTreeModel treeModel;
File selectFile;
Socket ClientSocket=null; //声名一个套接字
String HostName=null;int IPPort=0;
PrintWriter out二null;
BufferedReader in二null;
〃子窗口按钮
Dialog AddHost二null;
JTextField Computer二null;
JTextField Portl=nul1;
JButton ok=new JButton 〃确定“
JButton cancel=new JButton 〃取消〃
Dialog 1isten 二nul1;
JPasswordField passw 二new JPasswordField 10 ;
JButton okl =ncw JButton z确认〃 ;
JButton cancell =new JButton C取消〃 ;
File inputFile二new F订e 〃 d:/〃
File[] list=inputFile. listRoots ;int Jrate=O;int finish二0;int ByteNum;
String fileName;boolcan copy二false;public Ct ree ()
{this ( “远程管理器〃 ) ipublic Ctree(String Title)
{super (Title) ;
Imagetitlephone二Toolkit. getDefaultToolkit() . createlmage( 〃 • /icons/client. gi D;this. seticonimage (titlephone) ;this. setSize(600, 500) ;thi s. setJMenuBar(menu) ;tree. setShowsRootHandles(true) ;
setFont () ;addWindows () ;
// tree. setEditable(false) ;
CormectlpText. setEditable(false) ;addListen() ;try
{
File AdressFile=new
File( “HostAddress ・ txt") ;if(!AdressFile. exists() )
{
AdressFi1e. createNewFi1e () ;i
FileReader readln^new
FileReader (AdressFile) ;
BufferedReader bufin二new
BufferedReader(read!n) ;
String choiceList二null;
String address, port;while( (choiceList=bufin. readLine() ) !=nul
1)
{
Root.add (new
DefaultMutableTreeNode(choiceList) ) ;
Address.add (choiceList) ;
!
bufin. closeO ;rcadln. closeO ;this. setVisible(true) ;
倉・
2
、
在之前几个月中也有陆续提到两次HostYun主机商,这个商家前身是我们可能有些网友熟悉的主机分享团队的,后来改名称的。目前这个品牌主营低价便宜VPS主机,这次有可以看到推出廉价版本的美国CN2 GIA VPS主机,月费地址15元,适合有需要入门级且需要便宜的用户。第一、廉价版美国CN2 GIA VPS主机方案我们可看到这个类型的VPS目前三网都走CN2 GIA网络,而且是原生IP。根据信息可能后续...
【双十二】兆赫云:全场vps季付六折优惠,低至50元/季,1H/1G/30M/20G数据盘/500G流量/洛杉矶联通9929商家简介:兆赫云是一家国人商家,成立2020年,主要业务是美西洛杉矶联通9929线路VPS,提供虚拟主机、VPS和独立服务器。VPS采用KVM虚拟架构,线路优质,延迟低,稳定性强。是不是觉得黑五折扣力度不够大?还在犹豫徘徊中?这次为了提前庆祝双十二,特价推出全场季付六折优惠。...
10gbiz怎么样?10gbiz在本站也多次分享过,是一家成立于2020的国人主机商家,主要销售VPS和独立服务器,机房目前有中国香港和美国洛杉矶、硅谷等地,线路都非常不错,香港为三网直连,电信走CN2,洛杉矶线路为三网回程CN2 GIA,10gbiz商家七月连续推出各种优惠活动,除了延续之前的VPS产品4折优惠,目前增加了美国硅谷独立服务器首月半价的活动,有需要的朋友可以看看。10gbiz优惠码...