桌面小程序,帮助颈椎和帮助登录网页

Option Explicit
Dim strUsername,strPassword,vTag,objIE, i
strUsername = "xa20027" '用户名
strPassword = "zaq12wsx" '密码

Set objIE = WScript.CreateObject("InternetExplorer.Application","Event_")
objIE.Visible = True
objIE.Navigate2 "http://192.168.101.2/webAuth/index.htm?"
Wait_IE_Ready
objIE.Document.getElementById("username").value = strUsername
objIE.Document.getElementById("password").value = strPassword
'objIE.Document.Forms(0).submit

Wait_IE_Ready
Sub Wait_IE_Ready()
While objIE.Busy Or objIE.ReadyState <> 4
WScript.Sleep 500
Wend
End Sub
Sub Event_OnQuit()
WScript.Quit
End Sub


以上是帮助登录网号的vb程序,保存为.vbs格式,具体不解释了。



package com.helpNeck;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class HelpNeck {
    public static void main(String[] args) {
        while (true) {
            try {
                Thread.sleep(30*60000);

                final JFrame frame = new JFrame();
                final JLabel jlabel = new JLabel("休息一下脖子");
                frame.add(jlabel);
                frame.setLayout(null);
                frame.setBounds(100, 100, 1200, 700);
                jlabel.setBounds(100, 100, 100, 100);
                jlabel.setVisible(true);
                frame.setVisible(true);
                frame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent event) {
                        jlabel.setVisible(false);
                        frame.setVisible(false);
                    }
                });
            } catch (Exception e) {
            }
        }
    }
}
以上是帮助颈椎的程序,每隔半小时提醒一次,界面可以换,但是效果其实是一样的,就起到提醒作用。因为是Java程序,要把代码导出为.jar格式文件,然后放到桌面上,再在桌面上新建一个.bat格式的文件,内容是

javaw -jar helpNeck.jar
pause
只要电脑上安装了jdk,配好了环境变量,这个程序就可以跑起来了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章