读书人

c#访问路径有关问题,The path is not

发布时间: 2012-03-09 16:54:57 作者: rapoo

c#访问路径问题,The path is not of a legal form.
把总配置文件得到目录 ,然后放到ArrayList里面,然后再读出来,

public static void Run(ArrayList ss)
{
foreach (string s in ss)
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = s;//@ "d:\DownLoads ";//args[1];
/* Watch for changes in LastAccess and LastWrite times, and
the renaming of files or directories. */
//watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
// | NotifyFilters.FileName | NotifyFilters.DirectoryName;
//// Only watch text files.
watcher.Filter = "*.flv ";

// Add event handlers.
//watcher.Changed += new FileSystemEventHandler(OnChanged);
watcher.Created += new FileSystemEventHandler(OnCreated);
//watcher.Deleted += new FileSystemEventHandler(OnChanged);
//watcher.Renamed += new RenamedEventHandler(OnChanged);

// Begin watching.


watcher.EnableRaisingEvents = true;

}
}


Code2


string fn = myQ.Dequeue();
string temp = new FileInfo(fn).FullName;
Process P = Process.Start( "flvmdi.exe, " + temp);
WriteLog(fn, name);

c:\\Downloads\\

出现两个斜杠,应该怎么办

[解决办法]
检查temp的值

读书人网 >C#

热点推荐