|
No one here will write the program for you, but if you need help with writing the program the forums can help. And the program you are speaking of sounds like a basic program.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Looks like homework to me...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When is your homework due?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Here's a quiz question for you:
What happens when someone asks members of a CodeProject forum to do their homework for them?
When you figure out the answer, hopefully you'll understand what you have to do.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hellllooooooo. Hellloooooooo. Can you hear the wind whistling unhindered through the vast emptiness existing between your ears? It must be lonely for your last remaining braincell.
|
|
|
|
|
Hello all,
I have a C# project (.net 1.1) that references a .net dll. When this dll is put in the same folder as the project's executable file, everything works fine.
But I need to put this dll in another folder, not related to the project. I already tried putting it in system32 folder, but it still didn't work. I get a fileNotFound exception.
How can I do that?
Thanks
Peterson
|
|
|
|
|
Hi,
Try to give the dll reference thru browse(eg. say c:\test) not project reference and also make the property CopyLocal as false.
In addition, you give the path (c:\test) in ReferencePath tabe of Project's Property window.
Thanks
Srini
|
|
|
|
|
Hello,
I did this, and the program still can't find the dll.
Thanks
Peterson
|
|
|
|
|
Peterson Luiz,
Why do you want to do this anyways?, Is this dll used over multiple programs?, eg is a lib dll?
Can it be in the same program directory but in another folder?
eg: C:\YourProgy\DllFolder\name.dll ?
Also, when you say it doesn't work when putting it in the system32 folder. Have you built the program and then installed it on a another machine? or just running it in debug?
Regards,
Gareth.
|
|
|
|
|
Hi,
- Yes, I whant to do this because there are other programs using this dll.
- No, I needeed the dll in program files\my folder...
- Yes, I have built the program and tested in other computer.
Any ideas??
Thanks
Peterson
|
|
|
|
|
.NET will look for an assembly (your shared .NET dll) in the same directory as the executable or if it's not found there then the Global Assembly Cache (GAC). So, to share that DLL you'll either have to copy to both EXE directories or install it to the GAC.
|
|
|
|
|
I'm currently writing a little password-manager to store my passwords and the associated data my way.
Of course I would prefer the stored data not to be plainly readable to anyone, so I thought of encrypting it.
However, I couldn't really find any way of doing it elegantly.
1. I want to enter a password of my choice to encrypt it. Rijndael and others always need a key of a specific length, so the choice of passwords is limited to the accepted length .
2. Some methods I found need an input file and an output file. This is not particularly elegant, since one has to erase the input file (encryption) or the output file (decryption) afterwards, in order not to have a plainly readable version. Other methods encrypt a string, while I am serializing objects in a stream.
Here is what I have so far (without encryption):
Saving:
<br />
private void SaveFile(string path) {<br />
Stream stream = null;<br />
try {<br />
stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);<br />
<br />
MemoryStream memoryStream = new MemoryStream();<br />
GZipStream compressedStream = new GZipStream(stream, CompressionMode.Compress);<br />
IFormatter formatter = new BinaryFormatter();<br />
formatter.Serialize(memoryStream, ((PasswordList)ActiveMdiChild).List);<br />
memoryStream.WriteTo(compressedStream);<br />
<br />
compressedStream.Flush();<br />
compressedStream.Close();<br />
} catch (Exception r) {<br />
throw new ApplicationException("File could not be created " + r);<br />
} finally { if (null != stream) stream.Close(); }<br />
}<br />
Opening:
<br />
private void openToolStripMenuItem_Click(object sender, EventArgs e) {<br />
OpenFileDialog openFile = new OpenFileDialog();<br />
openFile.Title = "Open";<br />
openFile.InitialDirectory = Environment.CurrentDirectory;<br />
<br />
if (openFile.ShowDialog() == DialogResult.OK) {<br />
Stream stream = null;<br />
try {<br />
IFormatter formatter = new BinaryFormatter();<br />
stream = new FileStream(openFile.FileName, FileMode.Open, FileAccess.Read, FileShare.Read);<br />
GZipStream compressedStream = new GZipStream(stream, CompressionMode.Decompress);<br />
PasswordList newList = new PasswordList(this, (List<entry>)formatter.Deserialize(compressedStream));<br />
compressedStream.Close();<br />
<br />
newList.MdiParent = this;<br />
newList.filename = openFile.FileName;<br />
InitializeNewList(newList);<br />
} catch (Exception r) {<br />
throw new ApplicationException("File could not be opened" + r, r);<br />
} finally { if (null != stream) stream.Close(); }<br />
}<br />
}<br />
</entry>
Does anyone know an elegant way (not writing the file, encrypting it and then throwing away the original file) to include encryption and decryption with an arbitrary password (that I will get through a dialog) in that code.
|
|
|
|
|
|
I found that article too. But the problems I described are not solved by this method.
1. The method encrypts a string and decrypts to a string. I don't have a string! (Or I would first have to encrypt all the strings before serializing! )
2. The key for Rijndael has to be of a fixed length (128, 192, or 256 bits), so I can't use a password of my choice.
|
|
|
|
|
Some encryption methods always give a fixed length (I'm thinking of PHP's MD5 function). You could maybe encrypt the password you choose using something like that and then use that to do the Rijndael thing.
There's quite a few examples of MD5 PHP style encryption if you google but (from experience) check them carefully as I've found with some they don't always work properly. I remember one I tried that didn't give a leading Hex zero for bytes less than 16 (decimal) so what should have been
0A0A0A0A0A0A0A0A came out as AAAAAAAA - not fixed length.
I haven't tried it but this[^] one looks ok.
|
|
|
|
|
As indicated by a previous user, all you need to do is intantiate the cryptostream class on top of your GZipStream, then use the resulting stream to read/write the serialized data. As far as the password goes, I would try to add some random characters (salt) to your passphrase, then take the SHA256 hash of that new string and use the hash as the key to create a new Rijandael cryptostream which would be used as previously stated. Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Hello everyone.
Some time ago, I was working with Hashtables when I found a limitation: as an example I will use the following:
Hashtable countryInfo = new HashTable();
countryInfo.Add("Canada", "Ottawa");
countryInfo.Add("UK", "London");
countryInfo.Add("France", "Paris");
...
This is great: given the country France, I can find out that it's capital is Paris:
string capital = countryInfo["France"] What I can't do is find out is what country is Paris the capital of (without looping through the table).
So I created MultiHashTable which, instead of holding key,value pairs, holds key,key,key... sets. I can now do things like:
MultiHashTable countryInfo = new MultiHashTable("Country", "Capital", MultiHashTable.Unkeyed("Language"));
countryInfo.Add("Canada", "Ottawa", "English");
countryInfo.Add("UK", "London", "English");
countryInfo.Add("France", "Paris", "French");
(note: the "Language" table is "Unkeyed" because it must hold duplicate entries for Canada and UK).
Now I can find out what country has Paris as it's capital:
capital = countryInfo.GetItem("Country", "Capital", "Paris"); and other things that I needed to do.
My question is this - did I re-invent the wheel? I keep discovering all kinds of stuff already built into C# and I can't help but think that this sort of thing is already in there somewhere.
I won't consider my time wasted if it is - creating MultiHashTable was a great learning experience - I just want to know if at some time in the future someone is going to say "well why don't you just use System.Collections.SuperCrossRef like everybody else?"
Clive Pottinger
Victoria, BC
modified on Wednesday, January 23, 2008 1:42:53 PM
|
|
|
|
|
Iam not sure what version you are working on, i think this can be done with Dictionary(.net 2.0), Please take a look at it.
Thanks
Srini
|
|
|
|
|
I need a quick tutorial on how to build a wpf app without any IDE. I want to know this because Visual Studio generates a bunch of code and it attempts to hide most of it and the designer code just looks like a mess. I want to know the simplest COMPLETE boiler plate code nessecary to display a window with a button on it using XAML and C# using notepad and the command-line. I googled around but I cant seem to find what I want.
Word, write letters and sh*t yo.
It takes 46 muscles to frown but only 4 to flip 'em the bird.
Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
The greatest pleasure in life is doing what people say you cannot do.
Everyone needs believe in something. I believe I'll have another beer.
|
|
|
|
|
CataclysmicQuantum wrote: I googled around but I cant seem to find what I want.
Yeah that was tough[^]
two clicks away to this[^]
Building a WPF Application (WPF)
Windows Presentation Foundation (WPF) applications can be built as .NET Framework executables (.exe), libraries (.dll), or a combination of both types of assemblies. This topic initially shows how to build simple WPF applications from the command prompt, before showing how WPF leverages the extensibility of Microsoft build engine (MSBuild) to build more complex applications. This topic finishes by providing an in-depth discussion of the key steps in the MSBuild build process.
led mike
|
|
|
|
|
I had found that when I was looking, thats not quite what I am looking for.
I know how to use the command-line and all that. I just need a very simple tutorial that says something like "Create .cs file with class Program with Main(), add this code to it, create .xaml file...." Notice the 1 star rating on that MSDN article. I'm not the only one who doesn't liek it.
Word, write letters and sh*t yo.
It takes 46 muscles to frown but only 4 to flip 'em the bird.
Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
The greatest pleasure in life is doing what people say you cannot do.
Everyone needs believe in something. I believe I'll have another beer.
|
|
|
|
|
|
Thats perfect, thanks.
Word, write letters and sh*t yo.
It takes 46 muscles to frown but only 4 to flip 'em the bird.
Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
The greatest pleasure in life is doing what people say you cannot do.
Everyone needs believe in something. I believe I'll have another beer.
|
|
|
|
|
I'd help you, but the drug rehab is shut right now.
WPF - Imagineers Wanted
Follow your nose using DoubleAnimationUsingPath
|
|
|
|
|
Is it possible to get the name of the DLL your code is executing in?
For instance, I have MyLib.DLL that contains the class "MyClass". Inside MyClass, I have a function that needs to know the name of the DLL it's running in.
How does one accomplish that in .Net?
It's done like this:
Module mod = Assembly.GetExecutingAssembly().GetModules()[0];
string name = mod.Name;
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Wednesday, January 23, 2008 11:32:24 AM
|
|
|
|