Перевести код с Java - C# (189240)
Формулировка задачи:
Помогите пожалуйста эту программу переписать на C#
package findfile;
import java.io.*;
public class FindFile implements Runnable {
public static String fileNmae;
private String directory;
public static boolean isFind;
public FindFile(String directory) {
this.directory = directory;
isFind = false;
}
@Override
public void run() {
File[] files = (new File(directory)).listFiles(new FilenameFilter() {
@Override
public boolean accept(File file, String string) {
return string.equals(fileNmae) || file.isDirectory();
}
});
if (files == null || files.length == 0) {
return;
}
for (File file : files) {
if (file.isDirectory()) {
new Thread(new FindFile(file.getPath())).start();
} else if (file.getName().equals(fileNmae)) {
System.out.println(file.getPath());
return;
}
}
}
}package findfile;
public class Main {
public static void main(String[] args) throws InterruptedException {
FindFile.fileNmae = "1.mp3";
FindFile f = new FindFile("D:\\");
FindFile f1 = new FindFile("E:\\");
FindFile f2 = new FindFile("C:\\");
new Thread(f).start();
new Thread(f1).start();
new Thread(f2).start();
}
}Решение задачи: «Перевести код с Java»
textual
Листинг программы
private static final java.lang.reflect.Type field_152370_a = new ParameterizedType()
{
private static final String __OBFID = "CL_00000828";
public java.lang.reflect.Type[] getActualTypeArguments()
{
return new java.lang.reflect.Type[] {String.class, new ParameterizedType()
{
private static final String __OBFID = "CL_00001836";
public java.lang.reflect.Type[] getActualTypeArguments()
{
return new java.lang.reflect.Type[] {String.class};
}
public java.lang.reflect.Type getRawType()
{
return Collection.class;
}
public java.lang.reflect.Type getOwnerType()
{
return null;
}
}
};
}
public java.lang.reflect.Type getRawType()
{
return Map.class;
}
public java.lang.reflect.Type getOwnerType()
{
return null;
}
};