locked
인쇄 RRS feed

  • Question

  • 아래의 파일은  Visual Web Developer Express 2010의 Console Application 에서 작업한 것입니다

    문제는 인쇄할 내용이 한 페이지를 초과하는데 한장만 인쇄되고 끝나버리는것입니다

    아래의 파일를 어떻게 수정해야 합니까 ?  

    File is made by  Console Application in Visual Web Developer Express 2010.

    File is printed only 1 page.  How to amend to get full pages(2 pages).

    Please show me

     < My mail   is  "changghil @naver.com" >

     

     using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace ConsoleApplication1
    {
        class Program
        {
            private static StringBuilder sbPrint = new StringBuilder();
            static void Main(string[] args)
            {
                string strTemp = " ";

     

                Console.WriteLine("  숫자를 입력하세요  ");
                string a = Console.ReadLine();

                if (a == "1")
                {
                    strTemp = "  가나다\r\n 가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n가나다\r\n    ";
                    Console.WriteLine(strTemp);
                    sbPrint.AppendLine(strTemp);
                }
     

                System.Drawing.Printing.PrintDocument doc = new System.Drawing.Printing.PrintDocument();
                doc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(doc_PrintPage);
                doc.Print();
            }

            static void doc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
            {
                System.Drawing.Font font = new System.Drawing.Font("MS Sans Serif", 12);
                e.Graphics.DrawString(sbPrint.ToString(), font, System.Drawing.Brushes.Black, 10, 10);
            }

        }
    }

    • Moved by eryang Friday, April 8, 2011 2:40 AM (From:Visual Studio Debugger)
    Thursday, April 7, 2011 3:11 AM

All replies