类型或名称空间"TextFieldParser";找不到 [英] the type or namespace "TextFieldParser" could not be found
问题描述
我正在尝试使用在使用C#读取CSV文件中找到的TextfieldParser.我正在使用VS 2010,并在C#中执行此操作.
I am trying to use TextfieldParser that was found within Reading CSV files using C#. I am using VS 2010 and doing this in C#.
我一直在获取找不到类型或名称空间"TextFieldParser"."
I keep on getting "the type or namespace "TextFieldParser" could not be found.."
当我尝试添加using行时,它将仅使用Microsoft.VisualBasic.而不使用Microsoft.VisualBasic.FileIO;
When I try and add the using line, it will only go using Microsoft.VisualBasic; deep and not using Microsoft.VisualBasic.FileIO;
任何帮助都会很棒.
推荐答案
在Visual Studio中,右键单击 Solution Explorer
侧面板中的 References
.点击添加参考".
In Visual Studio, right click on References
in the Solution Explorer
side panel. Click "Add Reference".
在该列表中,请确保检查 Microsoft.VisualBasic
.点击确定.
In that list be sure to check Microsoft.VisualBasic
. Hit OK.
现在在名称空间中,使用Microsoft.VisualBasic.FileIO 添加.
Now in the namespace, add Using Microsoft.VisualBasic.FileIO
.
这将允许您使用TextFieldParser.有关如何使用它的一个很好的简单示例,请看这里:
That will allow you to use TextFieldParser. For a good, easy example on how to use it, look here: http://geekswithblogs.net/brians/archive/2010/07/07/whats-a-nice-class-like-textfieldparser-doing-in-a-namespace.aspx
这篇关于类型或名称空间"TextFieldParser";找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!