[C#] File Comparsion Program

Version 1.1 Release:

When you select the 'X', a message box will appear with two options: Yes and No. Yes will give you the option to save any changes, the first Save Dialog box will be for File 1 and the second Save Dialog box will be for File 2. The No option will simply exit the application without making any changes.
 

Attachments

Version 1.3 Release:

The program will now know if you have made any changes to a opened file, and ask if you would like to save these changes upon exiting the program. Thank you very much to AceInfinity for helping me with the final part of the program.

View attachment FileComparsion V1.3.zip
 
Now for some quick mentions...

1) That last:
Code:
else
	e.Cancel = false;

In your form closing method is redundant. False is default. And if the MessageBox result is "YES", and you just want to save, but not cancel the application from quitting... You don't need to set e.Cancel to true if you're later going to set it to false anyways. With all of that said, this means that you shouldn't ever have to change that Cancel property value... Any changes you make to this value are all redundant in your code.

2) There are ways around having a method per font size as well. If you're curious about some alternatives just ask. Same thing with the Color's. :)

Suggestions:

- Like Notepad (not invoked with elevated permissions because UIPI will be too complicated for you at this point), try to get your program loading files from dragging and dropping directly out of windows explorer.
- Perhaps try to see if you can do a line by line or char by char comparison, and calculate the % difference between the two files?

Taking this program to new levels will help you learn.
 
Last edited:
Can you post where I could find the alternatives and improvements on MSDN please? :thumbsup2:
 
Just assign all of the events to one method. Cast the sender (an Object) to a ToolStripMenuItem, and use the name or some unique property to validate what one was clicked. Otherwise, use something a bit more appropriate like a ComboBox in the ToolStrip. :)
 
Have done your first suggestion, and I'm going to work on adding a ComboBox for the font and colours :)
 
Not bad at all :)

Bug: For the new combo boxes, on File2, they are repeated more than once.

I'm not too keen on the installer at all - I use Visual Studio myself and have had many issues with that style of installer. Inno (Inno Setup) is, IMO, a much better installer system.

If you are using Visual Sudio Ultimate (like I am - I got it free from school ;)), then it can create InstallShield installers.

Stephen
 
I did notice that bug, when I complied the program again, the bug disappeared so I must have uploaded the version beforehand.

View attachment FileComparsion V1.4.zip

Bug Free.jpg

I've got the Express Edition of Visual Studio, my college haven't given me a e-mail address to validate that I'm entitled to free software from Microsoft.
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top