David Cumps
#region .Net Blog
-
Small Console ChatServer
using System;
-
MD5, SHA1, SHA256, SHA384, SHA512 Hash class article.
Today's article is about making hash functions easier to create.
We create a class around MD5, SHA1, SHA256, SHA384 and SHA512.
I've used this in a small project a while ago to hash passwords and it has proven really usefull.
Check it out if you need a hashing class: Create Hashes - MD5, SHA1, SHA256, SHA384, SHA512. -
Create Hashes - MD5, SHA1, SHA256, SHA384, SHA512
using System;
-
Your program as ShellExtension (Registry) - Including Resources
As a follow up to my C# Script program, I've added an article on how to associate your program with every file by adding a registry key.
I also made a small article about including resources in your .exe as an answer to someone's question about Non-Rectangular Forms.
The Notepad bug issue still spooks around in my mind. So very strange... -
Including Resources in .exe
FileStream imageStream = File.OpenRead("Glass.bmp");
-
Associating your program with every file - ShellExtension
Windows Registry Editor Version 5.00
-
Notepad bug? Encoding issue?
Someone showed me a weird text file today. It was a bat file with 'copy MeYou.bak MeYou.txt'. When you would ran it, it would work. But when you opened it in Notepad, there was nothing.
So we decided to look a bit into this and here is something we came up with to 'create' invisible text:
Open notepad and enter:
' abc.bak abc.txt'
(That is: space abc dot bak space abc dot txt, no line break, without the quotes)
It doesn't work with every string, just follow us on this example and use that one.
Save your file. Notepad picks default ANSI as encoding.
Open your file, Notepad seems to open by default in Unicode encoding.
Your text is now invisible.
Does anyone know why the saving default is different from the opening default?
And why does it happen to that particular piece of text. It doesnt happen to ' b.b b.b' or ' .bak .txt'.
It looks the same when viewing it through a hex editor. But apparently it has to do something with encoding.
Anyone who can explain?
Update: When you paste it in IE or Trillian you get '????????', like some people tried in the comments ;)
Update2: In my notepad screenshot the font was Terminal, when I choose Verdana it are indeed squares. Not that invisible anymore, but still wrong :)
Update3: You can find an explanation on why this is happening at The Old New Thing. -
C#-Script
I was playing around with the thought of being able to figure out some other possibilities for C#.
One thing I came up with was, why not make a possibility to quickly write something small in C# and run it. I'm talking really really really small here.
So I decided to write an article about it, maybe someone thinks of something and extends it. Before you tell me it's useless, let me say this is only something done to try out new things and to get ideas.
Here is my version of C#-Script ;)
One frustrating thing that keeps bothering me is. In code i specifically said to not create an executable, and what happens? It creates an executable. Anyone an idea of why it's doing this? Doesn't 'InMemory' mean in RAM, without files on your HD?
Hope you like it :) -
C# Script
using System;
-
Non-Rectangular Forms - C#
I added another article in the 'Basic C# Examples'-series. ;)
It should answer the question of how to make nonsquare windows?
There is another example out there (which I can't find the link of anymore) that uses pointers to run over the image. Because of performance issues. So, I decided to take the GetPixel approach and see if it worked. And it does ;) Don't notice any performance hit here thou, maybe on weaker computers..
How To Make Non-Rectangular Forms.