China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 16:39
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » curl 登录一个网站 (注:原句“curl登陆一个网站”中“登陆”是“登录”的意思,按要求直接翻译为“curl 登录一个网站”) View 1,590 Replies 11
Original Poster Posted 2008-08-28 19:41 ·  中国 广东 深圳 电信
初级用户
★★
Credits 153
Posts 103
Joined 2008-03-27 19:38
18-year member
UID 114210
Gender Male
Status Offline
http://www.netyi.net/ is a large and good e-book download website with a lot of materials uploaded by netizens. But generally, downloading things requires points (I spent more than ten yuan when I just registered). You can earn points by sending text messages and logging in (1 point per day), so I need to log in to http://www.netyi.net/jsLoginStatus.aspx once every day.

After packet capturing, it is post login. After thinking about it for a few days, I still can't log in. I don't know where the mistake is.

echo off
curl -c Cookie_netyi.txt "http://www.netyi.net/jsLoginStatus.aspx"
curl -H "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-icq, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" -d "Content-Type: application/x-www-form-urlencoded UserName=***&Password=***&Submit.x=0&Submit.y=0" -b Cookie_netyi.txt http://www.netyi.net/jsLoginStatus.aspx?returnUrl=%2fjsLoginStatus.aspx%3fguid%3d0638a989-eeac-400c-b265-ed1df0c7114d >>netyi.htm
pause

[ Last edited by kioskboy on 2008-9-7 at 03:53 PM ]
Floor 2 Posted 2008-09-02 19:32 ·  中国 广东 深圳 电信
初级用户
★★
Credits 153
Posts 103
Joined 2008-03-27 19:38
18-year member
UID 114210
Gender Male
Status Offline
If curl can't be implemented, can a VBS script work? Double-clicking can quickly log in.
Floor 3 Posted 2008-09-02 23:12 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Brother gxsanhen provided an AutoIt solution in the group. I wonder if it can be implemented with VBS, calling Brother slore.
Floor 4 Posted 2008-09-03 07:43 ·  中国 广东 深圳 电信
初级用户
★★
Credits 153
Posts 103
Joined 2008-03-27 19:38
18-year member
UID 114210
Gender Male
Status Offline
AutoIt is good, but it still needs to be compiled.
In the case of no other way, I will consider methods like sendkeys for simulated login.
Curl should work, right? Is there anyone who can tell me whether using curl can log in to this website, yes or no?
Floor 5 Posted 2008-09-03 20:29 ·  中国 浙江 杭州 电信
中级用户
★★
拟谷盗
Credits 312
Posts 108
Joined 2007-01-21 11:36
19-year member
UID 77238
Gender Male
Status Offline
curl -c Cookie_netyi.txt -d "UserName=***&Password=***&Submit=登录" http://www.netyi.net/jsLoginStatus.aspx?returnUrl=%2fjsLoginStatus.aspx%3fguid%3dae1f8e99-d322-44b0-8288-abc376a6a154
::Use the correct account and password to log in, and save the login information in Cookie_netyi.txt
FLOSS
Floor 6 Posted 2008-09-04 13:35 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Set ie = CreateObject("Internetexplorer.Application")
ie.Navigate "http://www.netyi.net/jsLoginStatus.aspx"
ie.Visible = True
While ie.Busy or ie.ReadyState <> 4
Wend
ie.Document.form2.UserName.value = "slore"
ie.Document.form2.Password.value = "slorelee"
ie.Document.form2.submit

Why not search well? I'm too lazy to write. Such a simple code don't tell me you don't understand. I searched according to the keywords I said and clicked the second link, modified the url and form name, and it can be used. I don't know why so many people like to take things ready-made... I hope it's not just as lazy as me, but that they can write it themselves. At least know the idea to achieve it. After all, such scripts are not universal, and there are too few usable places. So please write such targeted scripts yourself. If you don't understand, learn to search...
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 7 Posted 2008-09-04 13:45 ·  新加坡
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Brother slore finally made a move, learn.
Floor 8 Posted 2008-09-04 22:36 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
After successful login, can you automatically click "Logout" again?

I looked at the website code after logging in. "Logout" is a hyperlink:
<td><img src="images/3003.gif" width="9" height="9"><a href="/quit.aspx?returnUrl=%2fjsLoginStatus.aspx%3fguid%3d0833ef28-c56b-411f-85a4-3ffdf4a81d56">Logout</a></td>
Floor 9 Posted 2008-09-04 23:31 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
Does this also enable logging into some email boxes that don't require captchas??
Floor 10 Posted 2008-09-05 11:33 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
```vb
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "http://www.netyi.net/quit.aspx?returnUrl=%2fjsLoginStatus.aspx"

ie.Visible = True 'Set whether this IE object is visible here.

While ie.Busy Or ie.ReadyState <> 4: Wend

ie.Document.form2.UserName.value = "slore"
ie.Document.form2.Password.value = "slorelee"
ie.Document.form2.Submit

While ie.Busy Or ie.ReadyState <> 4: Wend

WSH.Sleep 1000 'This sentence is to let you see the successful login. Without this, the next sentence will exit directly.
ie.Navigate "http://www.netyi.net/quit.aspx?returnUrl=%2fjsLoginStatus.aspx"

While ie.Busy Or ie.ReadyState <> 4: Wend
ie.Quit 'You can decide whether to have it or not according to the situation. You can understand what it means by yourself.
```
Recent Ratings for This Post ( 3 in total) Click for details
RaterScoreTime
HAT +10 2008-09-05 11:55
kioskboy +2 2008-09-07 14:54
regvip2008 +2 2008-09-08 01:16
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 11 Posted 2008-09-05 11:54 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Got it, thanks a lot!
Floor 12 Posted 2008-09-07 14:59 ·  中国 广东 深圳 电信
初级用户
★★
Credits 153
Posts 103
Joined 2008-03-27 19:38
18-year member
UID 114210
Gender Male
Status Offline
Thank you everyone, thank you all the experts!
Forum Jump: