开发者

Get a folder name that contains and string and then open it?

开发者 https://www.devze.com 2023-02-01 06:26 出处:网络
This is the best i could do : If fileName.Contains(\"hi\") But what i want to do it . Open a folder : C:\\Documents and Settings\\5416339.5416339-PC\\Application Data\\ and navigate into a folde

This is the best i could do :

If fileName.Contains("hi")

But what i want to do it .

Open a folder : C:\Documents and Settings\5416339.5416339-PC\Application Data\ and navigate into a folder t开发者_如何学JAVAhat contains "hi" and then modify a file pref.js in it. (100% this file is in that folder and there is only one such folder)

Can you guys do this for me ?

Thanks..


Look at the Directory and DirectoryInfo classes.

Both have methods that will list the contained directories and files - this should give you enough to find a directory called hi.

As for modifying the file, without knowing more about this file and how you want to modify it, I can't help.

0

精彩评论

暂无评论...
验证码 换一张
取 消