c#,如何实现对某一文件夹刷新,就像电脑里右键刷新一样

c#,如何实现对某一文件夹刷新,就像电脑里右键刷新一样,有没有类似的源码参考一下,谢谢

直接调用
SendKeys.SendWait("{f5}");
如果是本程序,重新调用你加载文件夹的代码逻辑


private DirectoryInfo directoryInfo = null;
if (directoryInfo == null) directoryInfo = new DirectoryInfo(path);
directoryInfo.Refresh();
if (directoryInfo.Exists)
{
FileInfo [] fileInfo = directoryInfo.GetFiles();
}