I want to create class library project to use it in my projects but for now i don't know what is the best option to solve my problem.
I want to pass File that will chosen by OpenFileDialog
after that i want to pass selected file to my class function to get data about it ( Name, MimeType, Content of file & convert it to base64)
I don't have issue with base64 conversion or with create class lib or deploy it but my issue is what is the best option to pass this file to my function and work with it, I have options like pass file path or pass File
Object or pass FileStream
but how to get my required data (Name, MimeType, Content) from each option, I search for it and find many options when send file path but can anyone tell me this is good idea to work with or there is any better idea ? Thanks for help.
FileInfo fi = new FileInfo(path);
Now you can use, fi.Name, fi.Length, fi.Exists, etc.
replace the file path with fi
Example: File.ReadAllText("test.txt");
replace "test.txt" with fi.tostring();
and how to read is upto you