filechain.cs
来自「VC#里面的东西,大家可以看看」· CS 代码 · 共 37 行
CS
37 行
using System;
using System.Windows.Forms ;
using System.IO ;
using System.IO.IsolatedStorage ;
using CsharpPats;
namespace Chain {
/// <summary>
/// Summary description for FileChain.
/// </summary>
public class FileChain : Chain {
ListBox flist;
public FileChain(ListBox lb) {
flist = lb;
}
//-----
public override void sendToChain( string mesg) {
//if the string matches any part of a filename
//put those filenames in the file list box
string[] files;
string fname = mesg + "*.*";
files = Directory.GetFiles(Directory.GetCurrentDirectory(), fname);
//add them all to the listbox
if (files.Length > 0){
for (int i = 0; i< files.Length; i++) {
csFile vbf = new csFile(files[i]);
flist.Items.Add(vbf.getRootName());
}
}
else {
if ( hasChain()) {
chn.sendToChain(mesg);
}
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?