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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:39:26+00:00 2026-06-08T06:39:26+00:00

I am working on console application which fetch some data and call the MVC3

  • 0

I am working on console application which fetch some data and call the MVC3 Action method and pass the fetched data as a parameter to that action method.
But my problem is how console application get know that data pass successfully\MVC action method call correctly and on server mvc application is running or not

here is my code :

public static void Main()
{
// Mvc application object intialization
                HomeController object_Mail = new HomeController();
            // Mvc action method call
           object_Mail.mailgateway(mvcemails); //mvcemails parameter passed to Actionmethod               
}

Please guide me…

Thanks,
Raj

  • 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-08T06:39:29+00:00Added an answer on June 8, 2026 at 6:39 am

    You cant invoke an MVC action like you have done here, a desktop application and web application are unrelated.. They exist as two distinct entities.. Now if you need to call an mvc action from your desktop application it is like calling any other web end point using your desktop application and you need to create a HTTPRequest..

    In your desktop application create a HTTPRequest as follows:

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://"+ <your mvc action endpoint> )
    request.Method = "GET";
    //specify other request properties
    
    try
    {
        response = (HttpWebResponse)request.GetResponse();
    }
    

    if you want to pass some data to your action i.e action parameters you could build your url as follows:

    For Get Request

    string url = string.Format(
                "http://mysite/somepage?key1={0}&key2={1}",
                Uri.EscapeDataString("value1"),
                Uri.EscapeDataString("value2"));
    

    and
    For POST REQUEST

    webRequest.Method = "POST";
    var data=string.Format("key1={0}&key2={1}",Uri.EscapeDataString("value1"),Uri.EscapeDataString("value2")");
    StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream());
    requestWriter.Write();
    requestWriter.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a console application that tries to download some files from a
I m working on a console application that tries to download some files from
I am working on a console application to insert data to a MS SQL
Working with a Visual Basic.NET console application that features a VERY BASIC natural language
Right now, I have a console application I'm working on, which is supposed to
I have a threaded console application that is working fine, but it's architecture needs
I'm working on a console application which will be scheduled and run at set
I've got an app which I've tested as working as a console application. I've
I am working on application which processes large amount of text data gathering statistics
I am working on a console application that I want to run in the

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.