[英]How to rectify file not found exception in Windows application?
我正在使用 C# 在 Windows 应用程序中生成条形码。 我已经编写了代码,但在这里我无法生成条形码。 我收到一个错误,例如
未找到文件异常 (pfc.AddFontFile(_c39FontFileName);
请帮我。
我的代码是这样的:
MemoryStream ms = new MemoryStream();
c39.FontFamilyName = "c:\\FREE3OF9.TTF";
c39.FontFileName = "Free 3 of 9";
int barSize = System.Convert.ToInt32(txtFontSize.Text);
c39.FontSize = barSize;
c39.ShowCodeString = true;
if (txtTitle.Text + "" != "")
c39.Title = txtTitle.Text;
Bitmap objBitmap = c39.GenerateBarcode(txtrand.Text);
objBitmap.Save(ms, ImageFormat.png);
objBitmap.Save("c:\\image.png");
也许这
c39.FontFamilyName = "c:\\FREE3OF9.TTF";
c39.FontFileName = "Free 3 of 9";
本来应该
c39.FontFamilyName = "Free 3 of 9";
c39.FontFileName = "c:\\FREE3OF9.TTF";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.