相关疑难解决方法(0)

在.NET中获取默认打印机的最佳方法是什么

我需要获取默认的打印机名称.我将使用C#,但我怀疑这更像是一个框架问题而且不是特定于语言的.

.net

73
推荐指数
4
解决办法
9万
查看次数

22
推荐指数
3
解决办法
4万
查看次数

使用PrintDocument打印表单

我正在尝试MSDN使用PrintDocument打印的例子,但它并不是那么顺利.我已经完成了所有编译,但是当我点击打印时,会弹出"传真发送设置"窗口.这应该发生吗?我想打印,而不是发传真!

我需要更改什么才能直接打印到默认打印机?

谢谢!

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Printing;

namespace WindowsFormsApplication1
{
public partial class Form4 : System.Windows.Forms.Form
{
    private System.ComponentModel.Container components;
    private System.Windows.Forms.Button printButton;
    private Font printFont;
    private StreamReader streamToPrint;

    public Form4()
    {
        // The Windows Forms Designer requires the following call.
        InitializeComponent();
    }

    // The Click event is raised when the user clicks the Print button. 
    private void printButton_Click(object sender, EventArgs e) …
Run Code Online (Sandbox Code Playgroud)

.net c# forms printing printdocument

6
推荐指数
1
解决办法
3万
查看次数

标签 统计

.net ×2

c# ×2

printing ×2

forms ×1

printdocument ×1

windows ×1