找回密码
 加入
搜索
查看: 2770|回复: 5

[系统综合] 关于ftp登陆器的问题,请大神指点

[复制链接]
发表于 2017-2-9 10:03:09 | 显示全部楼层 |阅读模式
是这样的,我想做一个FTP登陆器,一个登陆框,包括输入账号,密码框,还有一个IP地址框,然后点确定就可以直接登陆FTP 最后使用CMD调用FTP,因为用浏览器不太好看,有没大神能指点下
发表于 2017-2-9 12:12:15 | 显示全部楼层
发表于 2017-2-9 12:20:04 | 显示全部楼层
如果要GUI页面可以自己画。
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 329, 205, 192, 124)
$Label1 = GUICtrlCreateLabel("FTP地址:", 48, 32, 60, 17)
$Button1 = GUICtrlCreateButton("登入", 80, 144, 73, 25)
$Button2 = GUICtrlCreateButton("退出", 184, 144, 73, 25)
$Label2 = GUICtrlCreateLabel("帐号:", 64, 80, 40, 17)
$Label3 = GUICtrlCreateLabel("密码:", 64, 112, 40, 17)
$Input1 = GUICtrlCreateInput("", 120, 72, 121, 21)
$Input2 = GUICtrlCreateInput("", 120, 104, 121, 21)
$Input3 = GUICtrlCreateInput("", 120, 29, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
 楼主| 发表于 2017-2-10 10:04:51 | 显示全部楼层
回复 3# 229989799


    大神,你上面的代码中有两个问题还请指点:第13-15行,虽然有了输入框,但是输入的内容无法获取,我看了CreateInput官方文档,这个函数返回值是控件ID,请问如何才能返回输入内容。
另外,19行以下的内容,我改成
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                        Case $Button1
                                Run(@ComSpec & " /c " & '@start explorer "ftp://xiao:xiao@10.29.3.20" ', "", @SW_HIDE)
                Case $GUI_EVENT_CLOSE
                        Exit
                                        Case $Button2
                                                Exit

        EndSwitch
WEnd
其中Run(@ComSpec & " /c " & '@start explorer "ftp://账号:密码@ftp地址" ', "", @SW_HIDE)
这条里,账号,密码,FTP地址,这三个能否实现引到之前 Input输入的内容呢
发表于 2017-2-10 10:48:50 | 显示全部楼层
本帖最后由 229989799 于 2017-2-10 11:13 编辑

GUICtrlread() ;读取输入信息
发表于 2017-2-10 11:12:37 | 显示全部楼层
本帖最后由 229989799 于 2017-2-10 11:22 编辑

我不是大神,也是刚学的新手,GUICtrlread的用法我也是论坛搜索出来的。交流一下,算不上指点。
#Region ### START Koda GUI section ### Form=
[code]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("ftp登录器", 330, 206)
$Label1 = GUICtrlCreateLabel("FTP地址:", 74, 34, 60, 17)
$Button1 = GUICtrlCreateButton("登入(enter)", 92, 152, 80, 25,0x0001);焦点在登入上,回车即可登入
$Button2 = GUICtrlCreateButton("退出(esc)", 196, 152, 80, 25)
$Label2 = GUICtrlCreateLabel("帐号:", 94, 80, 40, 17)
$Label3 = GUICtrlCreateLabel("密码:", 94, 112, 40, 17)
$Input1 = GUICtrlCreateInput("", 138, 32, 121, 21)
$Input2 = GUICtrlCreateInput("", 138, 80, 121, 21)
$Input3 = GUICtrlCreateInput("", 138, 112, 121, 21,0x0020)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $Button1
            Run("c:\windows\explorer.exe " & "ftp://" & GUICtrlread($Input2) & ":" & GUICtrlread($Input3) & "@" & GUICtrlread($Input1))
                        Exit
                Case $Button2
                        Exit
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-27 05:09 , Processed in 0.080224 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表