Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8890855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:35:51+00:00 2026-06-14T22:35:51+00:00

I am currently in the process of automating a web interface for administrating users

  • 0

I am currently in the process of automating a web interface for administrating users of an FTP.

I am trying to do this with HttpWebRequest, i have one call that logs me on the site and the second call is supose to add a new user for the FTP access.

I have tried my two urls in the browser and they work, they end up creating a user.

string login = "https://www.ftpsite.net/./panel/index.php?txvUsername=myaccount&txvPassword=myPassword&submitButton=Login";

this gets me logged in when i enter it in the browser address bar.

the second call to create a user is as follows.

string createUser = "https://www.ftpSite.net/panel/ftpsites/updatelogin?login_id=&login=toto123&realname=realnametoto&homedir=root&passwd=superpassword11&expdate=01-01-2100&neverExpire=on&quota_value=0&quota_unit=GB&group_id=0&status=on&ftp=on&filelist=on&ftp_download=on&http=on&web_filelist=on&web_download=on&email=";

This creates a user when i enter it in the browser’s address bar if it follows the one that logs us in.

My problem is that i am trying to do this using HttpWebRequest and without success. I can get myself logged in but when i try to create the user it seems to return a “bad” error code saying i have created too many users already which isnt the case since i can create more after that call. Here is the code i use with HtttpRequest

        _datCookie = new CookieContainer();
        HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(login);
        httpWebRequest.Method = "POST";
        httpWebRequest.CookieContainer = _datCookie;

        WebResponse response = httpWebRequest.GetResponse();
        referer = response.ResponseUri.AbsoluteUri;

        Stream requestStream = response.GetResponseStream();
        StreamReader streamReader = new StreamReader(requestStream);
        _datCookie = httpWebRequest.CookieContainer;
        response.Close();



        httpWebRequest = (HttpWebRequest)WebRequest.Create(createUser);
        httpWebRequest.CookieContainer = _datCookie;
        httpWebRequest.Referer = referer;
        httpWebRequest.Method = "POST";


        response = httpWebRequest.GetResponse();

        requestStream = response.GetResponseStream();
        streamReader = new StreamReader(requestStream);


        webBrowser.DocumentText = streamReader.ReadToEnd();

        response.Close();

What i caught and tried to imitate without success here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:35:52+00:00Added an answer on June 14, 2026 at 10:35 pm

    Are you sure they should be POST requests? The URLs seem to have all of the fields in the query-string, which suggests they should be GET requests instead.

    Based on the Fiddler screen-shot, you need to make a POST request with the fields in the body, not the query-string:

    var cookies = new CookieContainer();
    
    // Request 1 : Login
    var request = (HttpWebRequest)WebRequest.Create("https://www.ftpsite.net/./panel/index.php");
    request.Method = "POST";
    request.ContentType = "application/x-www-form-urlencoded";
    request.CookieContainer = cookies;
    
    string postData = "txvUsername=myaccount&txvPassword=myPassword&submitButton=Login";
    byte[] postBytes = Encoding.Default.GetBytes(postData);
    request.ContentLength = postBytes.Length;
    using (Stream bod = request.GetRequestStream())
    {
       body.Write(postBytes, 0, postBytes.Length);
    }
    
    WebResponse response = request.GetResponse();
    string referer = response.ResponseUri.AbsoluteUri;
    
    // Request 2 : Create user
    request = (HttpWebRequest)WebRequest.Create("https://www.ftpSite.net/panel/ftpsites/updatelogin");
    request.Method = "POST";
    request.ContentType = "application/x-www-form-urlencoded";
    request.CookieContainer = cookies;
    
    postData = "login_id=&login=toto123&realname=realnametoto&homedir=root&passwd=superpassword11&expdate=01-01-2100&neverExpire=on&quota_value=0&quota_unit=GB&group_id=0&status=on&ftp=on&filelist=on&ftp_download=on&http=on&web_filelist=on&web_download=on&email=";
    postBytes = Encoding.Default.GetBytes(postData);
    request.ContentLength = postBytes.Length;
    using (Stream bod = request.GetRequestStream())
    {
       body.Write(postBytes, 0, postBytes.Length);
    }
    
    response = request.GetResponse();
    requestStream = response.GetResponseStream();
    streamReader = new StreamReader(requestStream);
    webBrowser.DocumentText = streamReader.ReadToEnd();
    response.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have a process where we receive an inventory file from a vendor
I'm currently in a process of creating a new C project and I have
I'm currently in the process of setting my website, largely with php. Though this
I'm currently in the process of upgrading old II6 automation scripts that use the
We have a nightly build process that automatically versions all C++ projecs. Here's how
I have a script that is automating author re-writes on a number of git
I am currently working on automating/improving the release process for packaging my shop's entire
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently
We are currently evaluating different applications that interface with Visual Studio 2008 (C#) and
Currently I have subversion set up so that when I make changes in Eclipse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.