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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:20:46+00:00 2026-05-11T16:20:46+00:00

Well my situation is like this: I am generating a report as a text

  • 0

Well my situation is like this:

I am generating a report as a text file at the server which needs to be printed using DOS mode on a dot matrix printer. I want to avoid Windows printing because it would be too slow. Is there a way in ASP.NET through which I can carry out DOS based printing as it is best suited for Dot matrix printers. I have scoured the net but could not come across any solution or pointers. Does any body have any pointers/solutions which they might have implemented or stumbled across.

This application is a Web based application.

Thanx.

  • 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-05-11T16:20:46+00:00Added an answer on May 11, 2026 at 4:20 pm

    If I understand you right, one option is to execute a batch file that would do the actual printing from ASP.NET. From here: (Obviously, you can omit some of the code writing the output to the page)

    // Get the full file path
    string strFilePath = “c:\\temp\\test.bat”;
    
    // Create the ProcessInfo object
    System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("cmd.exe");
    psi.UseShellExecute = false; 
    psi.RedirectStandardOutput = true;
    psi.RedirectStandardInput = true;
    psi.RedirectStandardError = true;
    psi.WorkingDirectory = “c:\\temp\\“;
    
    // Start the process
    System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);
    
    
    // Open the batch file for reading
    System.IO.StreamReader strm = System.IO.File.OpenText(strFilePath); 
    
    // Attach the output for reading
    System.IO.StreamReader sOut = proc.StandardOutput;
    
    // Attach the in for writing
    System.IO.StreamWriter sIn = proc.StandardInput;
    
    
    // Write each line of the batch file to standard input
    while(strm.Peek() != -1)
    {
      sIn.WriteLine(strm.ReadLine());
    }
    
    strm.Close();
    
    // Exit CMD.EXE
    string stEchoFmt = "# {0} run successfully. Exiting";
    
    sIn.WriteLine(String.Format(stEchoFmt, strFilePath));
    sIn.WriteLine("EXIT");
    
    // Close the process
    proc.Close();
    
    // Read the sOut to a string.
    string results = sOut.ReadToEnd().Trim();
    
    
    // Close the io Streams;
    sIn.Close(); 
    sOut.Close();
    
    
    // Write out the results.
    string fmtStdOut = "<font face=courier size=0>{0}</font>";
    this.Response.Write(String.Format(fmtStdOut,results.Replace(System.Environment.NewLine, "<br>")));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well the situation is like this: i have form to login on my page
Well,my current situation is like this. When i search something on my site for
well i have this messages table with sample values like these: msg_id recipient_id read
I have a situation like below in which I have some problem in freeing
I have a piece of code which looks like this: Snippet A: class Creature
Imagine such situation that I have a function like this: Object f() { Object
Lots of words below, sorry - but I wanted to explain this situation well:
I have a situation like this. <php> <redirect the page > <exit> <javascript> <redirect
I have a DOM situation that looks like this: A is an ancestor of
Well, this is my first post here and really enjoying the site. I have

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.