我有一堆'gif'圖像。您的所有鏈接都是針對.txt文件的。這是我的代碼:
public void PrintShippingLabels()
{
//mock of what the reset of the program will produce up to this step
List<string> shippingLabels = new List<string>();
for (var i = 0; i < 10; i++)
{
var trackingNumber = "1ZR02XXXXXXXXXXXXX" + i + ".gif";
shippingLabels.Add(trackingNumber);
CreateSampleShippingLabel(trackingNumber);
}
Assert.AreEqual(10, shippingLabels.Count);
IceTechUPSClient.Instance.PrintLabels("", shippingLabels);
}
public void PrintLabels(List<string> shippingLabels)
{
//this is where I print to printer...
PrintDocument pd = new PrintDocument();
foreach (string labelPath in shippingLabels)
{
pd.Print();
}
}
這裏有一個教程:http://www.dreamincode.net/forums /主題/ 44330-打印進行中C%23 / – 2010-12-16 18:45:47