Csharp Snippet
måndag 12 november 2012
Moving to http://alexanderrasch.blogspot.se/
I have moved to http://alexanderrasch.blogspot.se/, cya there
tisdag 30 oktober 2012
Base64 Encoding/Decoding, Winform and C#
Base64, " is a group of similar encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The Base64 term originates from a specific" Read more
http://en.wikipedia.org/wiki/Base64
I read the full "article" on Wikipedia and i think it was interesting, Below are a few diffrentent context that use Base64.
http://en.wikipedia.org/wiki/Base64
I read the full "article" on Wikipedia and i think it was interesting, Below are a few diffrentent context that use Base64.
- Base64 can be used in a variety of contexts:
- Base64 can be used to transmit and store text that might otherwise cause delimiter collision
- Base64 is used to store a password hash computed with crypt in the /etc/passwd
- Spammers use Base64 to evade basic anti-spamming tools, which often do not decode Base64 and therefore cannot detect keywords in encoded messages.
- Base64 is used for PHP obfuscation.
- Base64 is used to encode character strings in LDIF files
- Base64 is often used to embed binary data in an XML file, using a syntax similar to <data encoding="base64">…</data> e.g. favicons in Firefox's bookmarks.html.
- Base64 is used to encode binary files such as images within scripts, to avoid depending on external files.
- The data URI scheme can use Base64 to represent file contents. For instance, background images and fonts can be specified in a CSS stylesheet file as data: URIs, instead of being supplied in separate files.
Credit's to Wikipedia for that information, Now back on topic i made a simple application using windows forms. I also played a little with event now on Form Load it will not update the lable "Lenght" but once From Loaded it will :).
You can either download full project from Sendspace our snippet from github our pastebin.
You can either download full project from Sendspace our snippet from github our pastebin.
Pastebin: http://pastebin.com/70iS2J9M
SendSpace: http://www.sendspace.com/file/pdqsvc
SendSpace: http://www.sendspace.com/file/pdqsvc
tisdag 23 oktober 2012
Filezilla And Pidgin Credentials Recovery Tool Part 2
Finally i managed to get some time off and share that snippet,
It use the Namespace .Xml, Before reading a file it check if file exist.
And txtOutPut is just a console that print's out the information.
Enjoy
It use the Namespace .Xml, Before reading a file it check if file exist.
And txtOutPut is just a console that print's out the information.
Enjoy
lördag 20 oktober 2012
Filezilla And Pidgin Credentials Recovery Tool
Filezilla and Pidgin is two application i used pretty much a every day,
I like Filezilla since it's simple the best free FTP client i know and Pidgin allow me to use more then just one IM account ate the same time.
One thing that i don't like about is that they both store the password in plain text, in .xml files.
Specially in C# reading a XML file is very easy and i will share a snippet later :)

First Filezilla have two file's we want to read from.
%AppData%\FileZilla\recentservers.xml
%AppData%\FileZilla\sitemanager.xml
And Pidgin only have one file where it stores user details.
%AppData%\.purple\Accounts.xml
Will post a snippet later and descripe as good as posssible.
I would also like to say thanks to SecurityXploded, for there articles and research.
And have a nice day...
http://securityxploded.com/passwordsecrets.php#Pidgin
http://securityxploded.com/passwordsecrets.php#FileZilla
I like Filezilla since it's simple the best free FTP client i know and Pidgin allow me to use more then just one IM account ate the same time.
One thing that i don't like about is that they both store the password in plain text, in .xml files.
Specially in C# reading a XML file is very easy and i will share a snippet later :)

First Filezilla have two file's we want to read from.
%AppData%\FileZilla\recentservers.xml
%AppData%\FileZilla\sitemanager.xml
And Pidgin only have one file where it stores user details.
%AppData%\.purple\Accounts.xml
Will post a snippet later and descripe as good as posssible.
I would also like to say thanks to SecurityXploded, for there articles and research.
And have a nice day...
http://securityxploded.com/passwordsecrets.php#Pidgin
http://securityxploded.com/passwordsecrets.php#FileZilla
tisdag 2 oktober 2012
Switch statement a short snippet - C#
What it does it that it handles multiple selections by passing control to one off it's case statement.
We read what the user type. in using Console.ReadLine(); and transform that into a string we name sWhereToGo Then we passe the string to our tiny switch statement. That will print out some thing like the second image.
And below we have the snippet enjoy.
Pastebin (Snippet) : http://adf.ly/DMeqY
Detect if debugger is attached - C#
Here is another small snippet, hopefully you will find it usefully.
The usage off detecting if debugger it attached i can thing about right now.
Would to prevent people from attaching a debugger will program is running etc a payed program.
We check if Debugger.IsAttached with a if-statement, if it's true we print "Debugger Attached" else
it will print "Debugger is not Attached".
Read about the System.Diagnostics.Debugger Msdn: http://msdn.microsoft.com/en-us/library/System.Diagnostics.Debugger.aspx
Another time another snippet : )
Pastebin (Source) http://adf.ly/DMbuk
The usage off detecting if debugger it attached i can thing about right now.
Would to prevent people from attaching a debugger will program is running etc a payed program.
We check if Debugger.IsAttached with a if-statement, if it's true we print "Debugger Attached" else
it will print "Debugger is not Attached".
Read about the System.Diagnostics.Debugger Msdn: http://msdn.microsoft.com/en-us/library/System.Diagnostics.Debugger.aspx
Another time another snippet : )
Pastebin (Source) http://adf.ly/DMbuk
Print a table with number from 1 to 100 in C#
This snippet will print a short table with number from 1 to 100,
Using the if-statement if (i % 10 == 0) what it does is that it check it we can divide variable i with 10.
If true it will print using Console.WriteLine( i + " "); Writeline makes it start on a new line.
But if not true it will print Console.Write(i+ " "); the diffrent between that is that it will not start on a new line.
A last notice is that we have Console.ReadKey(); to prevent the program from closing right after it's done with printing.
Pastebin http://adf.ly/DMWcC Have a nice day.
Using the if-statement if (i % 10 == 0) what it does is that it check it we can divide variable i with 10.
If true it will print using Console.WriteLine( i + " "); Writeline makes it start on a new line.
But if not true it will print Console.Write(i+ " "); the diffrent between that is that it will not start on a new line.
A last notice is that we have Console.ReadKey(); to prevent the program from closing right after it's done with printing.
Pastebin http://adf.ly/DMWcC Have a nice day.
Prenumerera på:
Kommentarer (Atom)