File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ public static string FromBase64(string str)
2424 return Encoding . UTF8 . GetString ( System . Convert . FromBase64String ( str ) ) ;
2525 }
2626
27+ public static byte [ ] ToByteArray ( string str )
28+ {
29+ return Encoding . UTF8 . GetBytes ( str ) ;
30+ }
31+
32+ public static string FromByteArray ( byte [ ] array )
33+ {
34+ return Encoding . UTF8 . GetString ( array ) ;
35+ }
36+
2737 // I have not tested the functions below. Proceed with caution.
2838
2939 public static string FromHex ( string str )
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+
3+ namespace CSSimpleFunctions
4+ {
5+ public class SimpleFileHandler
6+ {
7+ public static void Write ( string FilePath , string Content )
8+ {
9+ File . WriteAllText ( FilePath , Content ) ;
10+ }
11+
12+ public static string Read ( string FilePath )
13+ {
14+ return File . ReadAllText ( FilePath ) ;
15+ }
16+
17+ public static void Append ( string FilePath , string Content )
18+ {
19+ File . AppendAllText ( FilePath , Content ) ;
20+ }
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments