NND,公司用oracle Form/Report开发的web打卡系统只要输入工号密码进去在,打卡页面同登陆的界面再录入一次就表示登陆了。现在想自己做个系统关winform还是web的,目的就是实现定时(也就是每天上班前)打开系统,输入工号密码,打卡登陆这样的目的(嘿嘿,图个省力)。
现在偶没一点头绪,不知道如何下手。希望在打开“打卡系统”之后的步骤中如何实现,自己开发的程序中做对“打卡系统”的输入,选择相应菜单这样的动作,请大家帮忙,分不够再加,2天甩了300分 。。

解决方案 »

  1.   

    写一个winform,加一个web浏览器控件,指向打卡页面,然后写代码访问浏览器里页面的元素,填入用户名,密码,然后调用登陆按钮的click()方法。
      

  2.   

    写个winform
    系统启动就启动然后模拟的包就可以了可以用WebReuqest,HttpWebRequest
    Socket(这个难点)
      

  3.   

    利用FindWindow,FindWindowEx,SendMessage等API函数向“打卡系统"发送工号,密码以及点击
      

  4.   

    我知道winform可以添加浏览器控件,可以打开地址,问题在进入“打卡系统”之后,如何实现,平时我们用手动输入的动作。就象 登陆163邮箱一样,怎么才能使程序代替人工输入用户名密码这样的动作,以及进去邮箱之后点击“我的收件箱”这样的动作,如何用程序实现。
    To:wjq
    访问页面代码?可否具体点 能否给个小例子。
      

  5.   

    To yanlongwuhui:
    winform的窗口我用过可以用FindWindow捕获,但目标程序是web的,也可以用这个吗 ?暂没试过
      

  6.   

    web的,楼主参考下这篇文章
    http://www.cnblogs.com/HQT/archive/2005/10/08/250277.aspx
      

  7.   

    假设你用一个winform里加了个浏览器控建,并且url设为http://www.baidu.com/
    那么,在DocumentCompleted事件里,这么写,就可以给关键字那个文本框赋值为hello
            private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
            {
               webBrowser1.Document.GetElementById("kw").SetAttribute("value","hello");
            }
      

  8.   

    楼主你这样就行了,打开你的IE,敲入URL,显示出打卡界面后,点击菜单的页面->查看源文件.
    然后把这个txt发过来,大家就能帮你了.
      

  9.   

    如果是一般的web网站登陆能看源文件还好说,知道页面中控件名;但是这个是oracle Form的web页面,而且最要命的是,在正常进入登陆页面前有还有个小页面,点下 然后在弹出框中输入密码才能正常进入该系统的登陆页面.下面是在系统的登陆页面的 html源码
    <HTML>
    <!-- FILE: webutiljini.htm (Oracle Forms)                           -->
    <!--                                                                 -->
    <!-- This is the a HTML template file for running a form on the      -->
    <!-- web using JInitiator-style tags to include the Forms applet.    -->
    <!-- and a certificate regsitration applet for the WebUtil utility   -->
    <!--                                                                 -->
    <!-- IMPORTANT NOTES:                                                -->
    <!-- Default values for all the variables which appear below         -->
    <!-- (enclosed in percent characters) are defined in the servlet     -->
    <!-- configuration file (formsweb.cfg). It is preferable to make     -->
    <!-- changes in that file where possible, rather than this one.      -->
    <!--                                                                 -->
    <!-- This file uses several extra tags that are not present in the   -->
    <!-- default template files.  You should ensure that these are       -->
    <!-- present in the configuration that uses this template            -->
    <!-- The extra substitution Tags are:                                -->
    <!--  /forms90/webutil/webutil.jar,/forms90/webutil/jacob.jar = jar file containing the WebUtil code        -->
    <!--                   (by default this should be webutil.jar)       -->
    <!--   = Defines the current logging mode.           -->
    <!--                     Valid values: off|on|console|server|all     -->
    <!--                     (on == console)                             -->
    <!--   = Should errors be displayed in an alert   -->
    <!--                        as well as the programmer defined        -->
    <!--                        locations                                -->
    <!--                     Valid values: true|yes|false|no             -->
    <HEAD><TITLE>Oracle Application Server Forms Services - WebUtil</TITLE></HEAD>
    <BODY ><!-- Registration applet definition (start) -->
    <OBJECT classid="clsid:CAFECAFE-0013-0001-0017-ABCDEFABCDEF"
            codebase="/forms90/jinitiator/jinit.exe#Version=1,3,1,17"
            WIDTH="0"
            HEIGHT="0"
            HSPACE="0"
            VSPACE="0">
    <PARAM NAME="TYPE"       VALUE="application/x-jinit-applet;version=1.3.1.17">
    <PARAM NAME="CODEBASE"   VALUE="/forms90/java">
    <PARAM NAME="CODE"       VALUE="oracle.forms.webutil.common.RegisterWebUtil" >
    <PARAM NAME="ARCHIVE"    VALUE="/forms90/webutil/webutil.jar,/forms90/webutil/jacob.jar" >
    <COMMENT>
    <EMBED SRC="" PLUGINSPAGE="/forms90/jinitiator/us/jinit_download.htm"
            TYPE="application/x-jinit-applet;version=1.3.1.17"
            java_codebase="/forms90/java"
            java_code="oracle.forms.webutil.common.RegisterWebUtil"
            java_archive="/forms90/webutil/webutil.jar,/forms90/webutil/jacob.jar"
            WIDTH="1"
            HEIGHT="1"
            HSPACE="0"
            VSPACE="0"
    >
    <NOEMBED>
    </COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    <!-- Registration applet definition (end) -->
    <!-- Forms applet definition (start) -->
    <OBJECT classid="clsid:CAFECAFE-0013-0001-0017-ABCDEFABCDEF"
            codebase="/forms90/jinitiator/jinit.exe#Version=1,3,1,17"
            WIDTH="100%"
            HEIGHT="100%"
            HSPACE="0"
            VSPACE="0">
    <PARAM NAME="TYPE"       VALUE="application/x-jinit-applet;version=1.3.1.17">
    <PARAM NAME="CODEBASE"   VALUE="/forms90/java">
    <PARAM NAME="CODE"       VALUE="oracle.forms.engine.Main" >
    <PARAM NAME="ARCHIVE"    VALUE="f90all_jinit.jar,/forms90/webutil/webutil.jar,/forms90/webutil/jacob.jar" >
    <PARAM NAME="serverURL" VALUE="/forms90/l90servlet?ifcfs=/forms90/f90servlet?form=ua_wmenu&config=prc54uafprc&acceptLanguage=zh-cn">
    <PARAM NAME="networkRetries" VALUE="0">
    <PARAM NAME="serverArgs"
           VALUE="escapeParams=true module=ua_wmenu userid=  sso_userid=%20 sso_formsid=%25OID_FORMSID%25 sso_subDN= sso_usrDN= debug=no host= port= useSDI=yes">
    <PARAM NAME="heartBeat" VALUE="1">
    <PARAM NAME="separateFrame" VALUE="false">
    <PARAM NAME="splashScreen"  VALUE="">
    <PARAM NAME="background"  VALUE="">
    <PARAM NAME="lookAndFeel"  VALUE="generic">
    <PARAM NAME="colorScheme"  VALUE="red">
    <PARAM NAME="serverApp" VALUE="default">
    <PARAM NAME="logo" VALUE="">
    <PARAM NAME="imageBase" VALUE="DocumentBase">
    <PARAM NAME="WebUtilLogging" VALUE="">
    <PARAM NAME="WebUtilLoggingDetail" VALUE="">
    <PARAM NAME="WebUtilErrorMode" VALUE="">
    <PARAM NAME="WebUtilDispatchMonitorInterval" VALUE="">
    <COMMENT>
    <EMBED SRC="" PLUGINSPAGE="/forms90/jinitiator/us/jinit_download.htm"
            TYPE="application/x-jinit-applet;version=1.3.1.17"
            java_codebase="/forms90/java"
            java_code="oracle.forms.engine.Main"
            java_archive="f90all_jinit.jar,/forms90/webutil/webutil.jar,/forms90/webutil/jacob.jar"
            WIDTH="100%"
            HEIGHT="100%"
            HSPACE="0"
            VSPACE="0"
            serverURL="/forms90/l90servlet?ifcfs=/forms90/f90servlet?form=ua_wmenu&config=prc54uafprc&acceptLanguage=zh-cn"
            networkRetries="0"
            serverArgs="escapeParams=true module=ua_wmenu userid=  sso_userid=%20 sso_formsid=%25OID_FORMSID%25 sso_subDN= sso_usrDN= debug=no host= port= useSDI=yes"
            heartBeat="5"
            separateFrame="false"
            splashScreen=""
            background=""
            lookAndFeel="generic"
            colorScheme="red"
            serverApp="default"
            logo=""
            imageBase="DocumentBase"
            WebUtilLogging=""
            WebUtilLoggingDetail=""
            WebUtilErrormode=""
            WebUtilDispatchMonitorInterval=""
    >
    <NOEMBED>
    </COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    <!-- Forms applet definition (end) --></BODY>
    </HTML>
      

  10.   

    这个不难
    楼主是想用一个应用程序A去打开并获得另一个应用程序B的窗体和控件 并给他赋值后 单击B的一个Button吧先用vs的spy++去获得程序B的句柄 程序B上的控件ID
    然后
    using System; 
    using System.Collections.Generic; 
    using System.ComponentModel; 
    using System.Data; 
    using System.Drawing; 
    using System.Text; 
    using System.Windows.Forms; 
    using System.Runtime.InteropServices; namespace WindowsApplication1 

        public partial class FormF : Form 
        { 
            [DllImport("user32.dll")] 
            static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 
            [DllImport("user32.dll")] 
            static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem); 
            [DllImport("user32.dll", SetLastError = true)] 
            public static extern IntPtr FindWindowEx(IntPtr parentHandle, int childAfter, string className, string windowTitle); 
            [DllImport("user32.dll", EntryPoint = "SendMessage")] 
            static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, string lParam);         public FormF() 
            { 
                InitializeComponent(); 
            }         private void Form1_Load(object sender, EventArgs e) 
            { 
                  }         private void button1_Click(object sender, EventArgs e) 
            { 
                IntPtr hwnd; 
                IntPtr hwnd1;             hwnd = FindWindow(null, "Form1");             hwnd1 = FindWindowEx(hwnd, 0, "WindowsForms10.EDIT.app.0.3b95145", "");             SendMessage(hwnd1, 194, 0, "Hi");// 
            } 
        } 
    }
      

  11.   

    简直就是一个CS程序........= =||findwindow,findwindowex,sendmessage吧....
      

  12.   

    TO kevin_cheung:
    开玩笑吧,拿取winform窗体句柄的方法去找web窗口???MS不行吧