资源描述:
《创建asp组件修改《serv-u》ftp 的密码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、创建ASP组件修改《SERV-U》FTP的密码创建ASP组件修改《SERV-U》FTP的密码新建一《serv-u》ftp服务器,在asp中修改指定帐户的密码,写了一asp组件来修改《serv?u》ftp密码。启动《vb6.0》,选择新建activexdll,更改工程属性中的工程名称为“ftpcommand”,将class名改为xjnftp,源程序如下:privateconstscuseragent="vbwininet"privateconstinternet_open_type_preconfig=0privateconstinternet_open_typ
2、e_direct=1privateconstinternet_open_type_proxy=3privateconstinternet_invalid_port_number=0privateconstftp_transfer_type_binary=&h2privateconstftp_transfer_type_ascii=&h1privateconstinternet_flag_passive=&h8000000privateconstinternet_service_ftp=1privateconstinternet_service_gopher=2
3、privateconstinternet_service_http=3privatedeclarefunctioninternetopenlib"wininet.dll"alias"internetopena"_(byvalsagentasstring,byvallaccesstypeaslong,byvalsproxynameasstring,_byvalsproxybypassasstring,byvallflagsaslong)aslongprivatedeclarefunctionftpcommandlib"wininet.dll"alias"ftpc
4、ommanda"_(byvalhconnectaslong,byvalfexpectresponseasboolean,byvaldwflagsaslong,_byvallpszcommandasstring,byvallcontextaslong,phftpcommandaslong)asbooleanprivatedeclarefunctioninternetconnectlib"wininet.dll"alias"internetconnecta"_(byvalhinternetsessionaslong,byvalsservernameasstring
5、,byvalnserverportasinteger,_byvalsusernameasstring,byvalspasswordasstring,byvallserviceaslong,_byvallflagsaslong,byvallcontextaslong)aslongprivatehopenaslongprivatehconnectionaslongprivatedeclarefunctioninternetclosehandlelib"wininet.dll"_(byvalhinetaslong)asintegerprivatenewpasswor
6、dasstringprivateoldpasswordasstringprivateusernameasstringprivateurlstrasstring‘修改ftp密码主程序publicfunctiongetstr()asstringhopen=0hconnection=0dimnflagaslongdimstrcmdasstringnflag=internet_flag_passive‘建立ftp修改密码命令字符串strcmd="sitepswd"&oldpassword&space(1)&newpassword‘建立internet连接hopen=i
7、nternetopen(scuseragent,internet_open_type_direct,vbnullstring,vbnullstring,0)ifhopen=0thengetstr="不能打开连接。..."ifhopen<>0then‘与ftp服务器建立连接hconnection=internetconnect(hopen,urlstr,nternet_invalid_port_number,_username,oldpassword,internet_service_ftp,nflag,0)ifhconnection<>0thenbret=ft
8、pcommand(hconnectio