如何使用c#中的windows web表单搜索文件夹,然后在该文件夹中自动读取index.txt等特定文件? [英] how to search a folder and then read a particular file like index.txt automatically within that folder using windows web forms in c# ?
本文介绍了如何使用c#中的windows web表单搜索文件夹,然后在该文件夹中自动读取index.txt等特定文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c#中的windows web表单搜索文件夹,然后在该文件夹中自动读取index.txt等特定文件?
How to search a folder and then read a particular file like index.txt automatically within that folder using windows web forms in c# ?
推荐答案
用C#读取文本文件 [ ^ ]
till现在我写了这段代码......这段代码只是访问文件夹
till now I have written this code ...this code just accesses the folder
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication12
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void folderPath_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
this.label1.Text = folderBrowserDialog1.SelectedPath;
}
}
}
}
这篇关于如何使用c#中的windows web表单搜索文件夹,然后在该文件夹中自动读取index.txt等特定文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文