如何在spefied路径上提取/传输csv文件 [英] how to extracted/transfer csv file on spefied path

查看:123
本文介绍了如何在spefied路径上提取/传输csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们!

现在我正在使用Windows应用程序。我的客户端会询问提取到特定路径的(csv)文件。该路径可能由用户指定。在这里我的表格有5个复选框,如果选中复选框则显示浏览按钮和文本框..

这里我的代码:

hi friends!
now i am working with windows application.my clients is ask a (csv)file extracted to particular path. that path maybe specified by user. here my form have 5 check boxes, if checkbox is checked it show it browse button and textbox..
here my code:

string strFilePath = @"c:\srigates";
            if (checkBox5.Checked)
            {
                textBox5.Show();

                strFilePath = Path.Combine(strFilePath, checkBox5.Text);
                textBox5.Text = strFilePath;
                button7.Show();
            }
            else
            {
                textBox5.Hide();
                button7.Hide();
            }



当用户选择文件夹时,然后一些.csv文件被转发到特定文件夹。

现在我在那里。如何将.csv文件提取到指定文件夹?(注意:我是c#.net新手。)


when user choose folder, then some .csv file are trnsfered to specific folder.
now i am there. how to extract .csv file to specified folder ?.(note : i am new to c#.net.)

推荐答案

请你澄清一下你的问题,我的初步想法看你的代码是没有多大意义的。



除此之外,如果您只是尝试将CS​​V文件写入给定位置,而不是使用TextWriter类来执行此操作,

http://msdn.microsoft.com/en-us/library/system。 io.textwriter.aspx [ ^ ]



或者我最近遇到了以下CSV帮助程序类,它使事情变得更容易:



https://github.com/JoshClose/CsvHelper
Please can you clarify your question, my initial thoughts looking at your code is that it does not make much sense.

That aside, if you are just trying to write a CSV file to a given location than you can use the TextWriter class to do that,
http://msdn.microsoft.com/en-us/library/system.io.textwriter.aspx[^]

or I recently came across the following CSV Helper class that makes things easier:

https://github.com/JoshClose/CsvHelper


这篇关于如何在spefied路径上提取/传输csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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