Bytescout.spreadsheet是一个'命名空间',但用作'类型'错误。 [英] Bytescout.spreadsheet is a 'namespace' but is used like a 'type' error.

查看:69
本文介绍了Bytescout.spreadsheet是一个'命名空间',但用作'类型'错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的代码。在调试时它显示两个错误:

The following is the code that i have. On debugging it shows two errors:

Bytescout.spreadsheet is a 'namespace'; but is used like a 'type'.



以下是代码:


The following is the code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bytescout.Spreadsheet.Demo.Csharp.ExportTo2DArray
{
    class Program
    {
        static void Main(string[] args)
        {
            const string inputFile = @"data.xls";

            // Open and load spreadsheet
            Spreadsheet spreadsheet = new Spreadsheet(); //**error in this line
            spreadsheet.LoadFromFile(inputFile);

            // Get the data from the spreadsheet
            string[,] data = spreadsheet.ExportTo2DArray();

            // Close spreadsheet
            spreadsheet.Close();

            // Display data in data table
            for (int i = 0; i < data.GetLength(0); i++)
            {
                for (int j = 0; j < data.GetLength(1); j++)
                {
                    Console.Write(data[i, j] + " ");
                }
                Console.WriteLine();
            }

            // Pause
            Console.ReadLine();
        }
    }
}

推荐答案

因为你付了很多钱来许可这个广告产品,这里的代码直接从他们的网站上复制[ ^ ],为什么不提交支持票?如果您使用的是试用版本,试用版是否可能已过期?



您报告的错误最常见的原因是您没有适当的参考设置到必要的DLL。在Visual Studio Solutions Explorer中打开'References并检查那里有什么;如果有必要,从其上下文菜单中选择添加引用并执行正确的操作以查找所需的dll。



尝试将其放入'using statements:



使用ByteCount;



看看是否编译。
Since you paid a lot of money to license this commercial product, and your code here is directly copied from their web-site [^], why don't you submit a support ticket ? If you are using a "trial" version, is it possible the trial has expired ?

The most common cause of the kind of error you report would be that you do not have a proper reference set to a necessary dll. In Visual Studio Solutions Explorer open 'References and examine what is there; if necessary select 'Add Reference from its context menu and do the right thing to find the required dll.

Try putting this in the 'using statements:

using ByteCount;

And see if that compiles.


这篇关于Bytescout.spreadsheet是一个'命名空间',但用作'类型'错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆