找不到类型或名称空间名称"Bytescout"(您是否缺少using指令或程序集引用?) [英] The type or namespace name 'Bytescout' could not be found (are you missing a using directive or an assembly reference?)
本文介绍了找不到类型或名称空间名称"Bytescout"(您是否缺少using指令或程序集引用?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
plz先生,请帮我进行以下编码
plz help me out sir for following coding
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Drawing.Imaging;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.Collections.Generic;
using Bytescout.BarCodeReader;
namespace WebTestSharp
{
public partial class _Default : System.Web.UI.Page
{
protected void UploadButton_Click(object sender, EventArgs e)
{
String savePath = @"\uploads\";
if (FileUpload1.HasFile)
{
String fileName = FileUpload1.FileName;
savePath += fileName;
FileUpload1.SaveAs(Server.MapPath(savePath));
Reader barcodeReader = new Reader();
// reader.MediumTrustLevelCompatible = true; // uncomment this line to enable Medium Trust compatible mode (slows down the recognition process as direct image data access is disabled in Medium Trust mode)
UploadStatusLabel.Visible = false;
ListBox1.Items.Clear();
ListBox1.Visible = true;
ListBox1.Items.Add("Reading barcode(s) from image #" + imgNum);
FoundBarcode[] barcodes = barcodeReader.ReadFrom(savePath);
if (barcodes.Length == 0)
{
ListBox1.Items.Add(" No barcodes found");
}
else
{
foreach (FoundBarcode barcode in barcodes)
ListBox1.Items.Add(String.Format("Found barcode with type '{0}' and value '{1}'", barcode.Type, barcode.Value));
}
}
else
{
// Notify the user that a file was not uploaded.
UploadStatusLabel.Text = "You did not specify a file to upload.";
}
}
}
}
推荐答案
因为Bytescout仅在该代码中作为using语句的一部分被提及:
Since Bytescout is only mentioned in that code as part of the using statement:
using Bytescout.BarCodeReader;
可能您尚未为包含类或名称空间的程序集添加引用. br/>
参见此处: MSDN:如何:在Visual Studio中添加和删除引用( C#)" [
The chances are you have not added a reference to the assembly containing the class or namespace.
See here: MSDN: "How to: Add and Remove References in Visual Studio (C#)"[^]
[edit]typo[/edit]
这篇关于找不到类型或名称空间名称"Bytescout"(您是否缺少using指令或程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文