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 8068057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:31:58+00:00 2026-06-05T12:31:58+00:00

So I have a program that takes in the user credentials via Windows form,

  • 0

So I have a program that takes in the user credentials via Windows form, Now through the MessageBox I am currently displaying the user input, what I am trying to do is pass it into my console application so that if the user enters in the correct credentials it then continues in the console application, how do I go about doing this?

  • 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-05T12:32:00+00:00Added an answer on June 5, 2026 at 12:32 pm

    you may need to add a while loop to look for a txt file in your console application. In your windows forms application, you can write a success or failure message into a txt file. (Add encryption for security) The moment you write down the information your console app should read it and continue from there.

    Algorithm:
    1.console application start
    2. console app while loop until txt file detected
    3. forms app show input screen
    4. user enter credential
    5. write success or failure into txt file
    6. read txt file
    7. continue based on credential result
    8. Remove txt file
    

    Since the form is also in the console app project (I assume it from your wordings) you can do the following

    class Program
    {
        public static object abc;
        static void Main(string[] args)
        {
            //do something here if required
            Form1 frm = new Form1();
            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //login success do what ever on success
                Console.WriteLine("Login success");
                Console.WriteLine(abc.ToString());
            }
            else
            {
                Console.WriteLine("Login failure");
                Console.WriteLine(abc.ToString());
                //login failure
            }
            Console.ReadLine();
        }
    }
    

    and the login button click event in your login form class

     private void Login_Click(object sender, EventArgs e)
        {
            if(true)
            {
                Program.abc = "any success object here";
                //on successful login
            this.DialogResult= System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                Program.abc = "any failure object here";
                this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            }
        }
    

    Thanks,

    Esen

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C++ program that takes user input for fopen in order to
Currently I have a program that takes as input a folder that contains .MPP
I have a perl program that takes input and output file arguments, and I'd
I am making a program that takes input from files that I have called
Question cribbed from here : I have a program that takes input from stdin
I am currently writing a program which takes user input and creates rows of
I'm writing a tiny program that takes user input using Getops, and based on
I am writing a program that takes in an input file from the user.
I have a query that takes input from the end user and compares it
I've been trying to make a simple program that takes the user input, until

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.