德尔福发布“非法访问”错误

发布于 2024-09-02 11:59:27 字数 1398 浏览 1 评论 0原文

我正在使用 Indy 中的 IdHttp 模块制作一些简单的 Delphi 软件。我想通过使用IdHttp的post功能打开此网页来访问此页面

首先,我必须登录(在 http://user.buddybuddy.co.kr /Login/Login.asp),所以我登录了,但是登录网页后我可以看到另一个登录页面。但是当我尝试登录时(位于 http://user.buddybuddy.co.kr/ usercheck/UserCheckPWExec.asp),我遇到错误消息“非法访问”。

如果有人可以帮助我,我将不胜感激!

        begin
      sl.Clear;
      sl.Add('ID=ph896011');
      sl.add('PWD=pk1089');
      sl.add('SECCHK=0');
      IdHTTP1.HandleRedirects := True;
      IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
      memo1.Text:=idhttp1.Post('http://user.buddybuddy.co.kr/Login/Login.asp',sl);

      if pos('top.location =',Memo1.Text)> 0 then

       begin
        application.ProcessMessages;
        sleep(1000);
        Memo1.Text:= '';
        sleep(300);
        sl2.Clear;
        sl2.Add('PASSWD=pk1089' );
        Memo2.Text := IdHTTP1.Post('http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp', sl2);


        sleep(300);
        Memo1.Text := '';
        //memo1.Text := IdHTTP1.Get('https://user.buddybuddy.co.kr/Login/Logout.asp');
        //Sleep(1000);
       end;

I'm making some simple Delphi software using the IdHttp module in Indy. I want to access this page by using IdHttp's post function to open this webpage.

Firstly I have to log in, (at http://user.buddybuddy.co.kr/Login/Login.asp), so I logged in, but after I logged in to the webpage I can see another login page. But when I try to login (at http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp), I encountered an error message, "Illegal access."

If anyone can help me I would appreciate it!

        begin
      sl.Clear;
      sl.Add('ID=ph896011');
      sl.add('PWD=pk1089');
      sl.add('SECCHK=0');
      IdHTTP1.HandleRedirects := True;
      IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
      memo1.Text:=idhttp1.Post('http://user.buddybuddy.co.kr/Login/Login.asp',sl);

      if pos('top.location =',Memo1.Text)> 0 then

       begin
        application.ProcessMessages;
        sleep(1000);
        Memo1.Text:= '';
        sleep(300);
        sl2.Clear;
        sl2.Add('PASSWD=pk1089' );
        Memo2.Text := IdHTTP1.Post('http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp', sl2);


        sleep(300);
        Memo1.Text := '';
        //memo1.Text := IdHTTP1.Get('https://user.buddybuddy.co.kr/Login/Logout.asp');
        //Sleep(1000);
       end;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瘫痪情歌 2024-09-09 11:59:27

服务器几乎肯定会通过返回一个 cookie 以及 Login.asp 请求的响应来跟踪您是否已登录。您需要将该 cookie 与任何后续请求一起发送回。要跟踪 cookie,请创建一个 TIdCookieManager 对象并将其分配给 HTTP 对象的 CookieManager 属性。第一个请求将在此处存储响应的 cookie,而同一 HTTP 对象上的下一个请求将把它们发回,向服务器表明您已经登录。

The server almost certainly keeps track of whether you're logged in by returning a cookie with the response from the request for Login.asp. You need to send that cookie back with any subsequent requests. To keep track of cookies, create a TIdCookieManager object and assign it to your HTTP object's CookieManager property. The first request will store the response's cookies there, and the next request on that same HTTP object will send them back, indicating to the server that you have already logged in.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文