Skip to content

Commit cd636cb

Browse files
added readme.md
added readme file for publishing
1 parent 66aad30 commit cd636cb

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CSharpFinder
2+
3+
Ever wondered if it's possible to find all C# / .NET assemblys / files / dlls in a directory? The answer is yes. Some time ago i needed a tool like this for private usage and thought: it may be that others will also need it sometime.
4+
5+
This repository brings you a little tool to find C# .NET assemblies in a directory. It's a console application where you can insert the path your files are stored in. This path will be searched.
6+
7+
8+
## Usage
9+
This is how you can use the program:
10+
11+
- start the exe file
12+
- copy and paste the path where your c# assemblies / files are stored in
13+
- press enter
14+
15+
Now the program searches for all files in the given directory and checks if its a C# / .NET file. All found C# / .NET files will be printed in the console. Ex.:
16+
17+
```
18+
File found: C:\user\username\source\repos\Program\DynamicLinkLibrary.dll
19+
File found: C:\user\username\source\repos\Program\Executeable.exe
20+
...
21+
```
22+
23+
After that all found files will be copied in the programs' directory in subdirectory "result", so you dont have to search them by yourself.
24+
25+
After all files are copied there will be a short summary about the scan. Ex.:
26+
27+
```
28+
Found files: 2
29+
Copied C# files: 2
30+
Errored files: 0
31+
```
32+
33+
**NOTE**: If a file cannot be opened because of missing permissions or because of a opening / reading problem, the file will be marked as "errored". Error files will not be scanned / copied. If you want to scan this files anyway, please be sure to check your permissions / restart as administrator. ❗
34+
35+
After the summary the program will ask you if you want to open the "result" directory where the copied c# files / assemblies are copied in. You just have to press '**Y**' to open it or '**N**' to discard.
36+
37+
If there is any errors, the program will ask you if you want to open the log file. The program created log files for errors. They will be stored in the programs directory in subdirectory "logs". The log file will be created new for every day.
38+
39+
## Code
40+
[Here](https://github.com/mauricepreiss/CSharpFinder/blob/master/CSharpFinder/Program.cs#L260)
41+
is the code on how to program identifies a file as a c# assembly:
42+
```C#
43+
private static bool IsCSharpAssembly(Assembly assembly)
44+
{
45+
return assembly.GetCustomAttributes(typeof(CompilerGeneratedAttribute), inherit: false).Any() ||
46+
assembly.GetTypes().Any(type => type.GetCustomAttributes(typeof(CompilerGeneratedAttribute), inherit: false).Any() ||
47+
type.FullName?.StartsWith("System", StringComparison.Ordinal) == false);
48+
}
49+
```
50+
This will be expanded in the future so more checks will be added.
51+
52+
❗❗ **This program is written in german, so the console instructions will be in german in the code. Also the comments are in german. If there is an request, i can send a version with english comments. If you want to use the program in english, please download the "CSsharpFinder-EN-{CurrentVersion}" package.** ❗❗
53+
54+
If there is any problem with the usage of this program, please create an issue.
55+
56+
## License
57+
- free for commertical use
58+
59+
## Author
60+
[@mauricepreiss](https://www.github.com/mauricepreiss)

0 commit comments

Comments
 (0)