|
I'm not sure what checking for changes would do for me. I already do that in the GUI. What I'm looking for is a way to write out the contents of the file so that it can't be read/edited in Notepad (at least, not without hosing it). You know, like when you rename an exe to txt and look at it in Notepad? Or, when you open an xls file in Notepad? I want my plain-text file to look like that goble-dee-guke, instead of looking like readable text.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
When your file is in binary format there is no quick way to validate that it is indeed accurate. Your application could execute assuming correct data. Having the hash will allow you to verify that if the file was changed at least it was changed by some one with enough knowledge to recompute the hash correctly. In a robust system knowledge of errors is half of the problem.
I don't understand what is not to be impressed about RE Binary Readers and Writers, however. They seem like fairly simple to use streams.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I think I remember trying BinaryWriter and BinaryReader and not being impressed... maybe it has to do with what flavor of Write() I was calling...
I'll look deeper into BinaryWriter/Reader, and I'll look into what BinaryFormatter would do for me...
As far as encryption, I didn't want to go that far.
Thanks for the tips!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Encryption is the best way. There are a lot of ways to do it. Also you may store a checksum at the end of the file and verify if the file was modified using checksum.
The BinaryWriter/BinaryReader option don't like me. It's not very safe.
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
Hi All,
I'm currently designing an "n tier" app to help manage my company's functions (incidentally, if you're wondering why they let a n00b like me at a project like this, there's only 5 of us and I once saw a computer back in 1985 )
I've broken it down into three layers, as per the advice from various guru's hither and thither: the data layer, the business logic layer and the client layer.
Now the data layer and client layer are within my experience - the data sits on a SQL Server server and the client layer is the app I write for the users.
Where I come unstuck is with the BLL. Where on earth should this go? On the ASP.Net forums I read an article about how you should implement the BLL as a serperate Class Library project (my app will be Win forms, but hopefully having a BLL gives me the option of doing some web stuff later if I can be bothered). All well and good so far...
...but where do you put this class library once it's finished? Distributing it with the client app seems a bit pointless, as any updates mean users have to reinsatll or whatever. This leads me to the conclusion I need to put it on a server soemwhere: but if I do this, how do I make the client app aware that it should be referencing these dll's? Can I just add them as project references and let .net handle the location when the app is distributed? Do I need to implement the whole BLL as a webservice? Also, as for performance, if the BLL is located on another computer, does this mean that it executes on the server, or is it downloaded and run on the client?
Any tips, articles, guides appreciated
|
|
|
|
|
Web services have provided the best abstraction for middle-tier architecture that I have seen. Depending on the number of users and the difficulty up updating you may be able to get away with your middle-tier class library existing on client machines (poor man's 3 tier apps)
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
If you are using .NET 2.0 you have the option to distribute your app using ClickOnce. This would give the best of best worlds sort of. The app lives and breaths on the client but updates are available on a server.
Web Services are also a good idea but you have to consider the usage of the app and frequency of updates. Obviously if you only plan to update your app once a year ditributing a new version with the latest code isn't to much of hassle, relatively speaking. On the other hand if your app may need to work in a disconnected or limited connection environment then WebServices wouldn't work.
|
|
|
|
|
Okay I have this Interface:
interface myInterface
{
public void visible(bool view);
}
I was implementing the visible method in my other classes like this:
visible(bool view)
{
if(view)
{
this.Left = -500000;
blah blah blah
}
else
{
this.left = 0;
blah blah blah
}
}
Okay I need to change my interface to an abstract class, so i can just implement the visible method one time in the abstract, but i can't use "this.Left" in the abstract because it doesnt contain a method for "Left".
It is probably a simple solution to this but how do I get this.Left, this.dock etc. to be available for use in my abstract class?
|
|
|
|
|
Make an abstract property get-set called Left which the derived classes override.
:josh:
My WPF Blog[^]
|
|
|
|
|
further to Josh's suggestion, the point of an abstract class is to abstract the functionality (as the name implies). Something like this would satisfy
public abstract class AbstractThing : myInterface
{
protected abstract void SetVisible();
protected abstract void SetInvisible();
public void Visible(bool view)
{
if(view)
SetVisible();
else
SetInvisible();
}
}
then your derived class, which has the Left property defined.
public DerivedThing : AbstractThing
{
protected override void SetInvisible(){ this.Left = -50000; }
protected override void SetVisible(){ this.Left = 0; }
}
or say you derive it and you wantr different behaviour for SetVisible and SetInvisible..eg/
public OtherDerivedThing : AbstractThing
{
protected override void SetInvisible(){ this.Visible= false; }
protected override void SetVisible(){ this.Visible = true; }
}
---
How to get answers to your questions[^]
-- modified at 10:36 Friday 14th July, 2006
|
|
|
|
|
Hi,
I have the following problem when trying to use Custom Controls published here at CodeProject with the full source code:
1.) I add the control source to my project
2.) Project compiles, everythings fine.
When I now want to add the control using the designer, I have to import it from the binary assembly the project has created ( so I'm referencing myself). Is there another way of registering in the toolbox just using the sourcecode ?
Its a bit annoying, because I get a warning that I'm using a different type. The most ExampleProjects have all integrated, but don't reference the outputbinary for having designer support.
I don't want to create a separate assembly containing all controls at the moment and I didn't found another solution yet.
Many thanks,
Florian
|
|
|
|
|
I think VS 2005 hadnles this issue better than VS 03. For VS2003 and if the control is inheriting from UserControl than double clicking it (so that the designer view pops up) then it should automatically being added to the toolbox.
|
|
|
|
|
Hi Robert,
if I click on the control sourcecode item ( e.g. Control.cs) i get a screen with the follwing text (window tab says "Control.cs [Design]":
To add components to your class, drag them from the Toolbox and use the Properties window to set their properties. To create events for your class, click here to switch to code view.
Well, that pretty obvious, but I have no idea how to convince the toolbox when editing a form to display the control which is only existing in sourcecode at that moment. Ok, it seems that the Control I use is not inherited from UserControl, so it may not work here.
But you mean, if doubleclicking the sourcefile in the project should be enough if it is inherited from UserControl ?
Thanks,
Florian
|
|
|
|
|
Keep the control code seperate from your own. Make the control it's own seperate Project, then you can have it show up in the ToolBox.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Silly Question~
Which Component Reference do I need to use the StreamWriter Class?
Thanks in advance.
|
|
|
|
|
No reference needed.
Juz include
System.IO Namespace
|
|
|
|
|
Hi, all.
I'm trying to create an RFID application and related hardware using C# but couln't find any resource. Could anyone please tell me where I can learn about these stuffs. I've been searching for quite awhile but couldn't find it. When it comes to firmware programming, they mostly use C++, not C#. Please help.
KiT
|
|
|
|
|
Hi KiT,
do you want to program a firmware using C# or do you just want to acess functions using an existing SDK for your hardware ?
Firmware Programming using C# doesn't works at the moment I suppose, because you would need a CLR (common language runtime) for your desired microcontroller. But the most microcontrollers have a C/C++ compiler generating native code, which can be executed by them, so I suppose you have at the least to use C/C++, which is very common in the embedded world (despite a few native java processors).
Bye,
Florian
|
|
|
|
|
I see. Thank you very much, Florian. I've understood correctly that I intended to use only C# for embeded programming. But, aww... okay, I'll try C++ (I hate pointers -_-"). Thank you again for your help.
KiT
|
|
|
|
|
Just be glad that you've got C and don't have to write in asm. Specialty embedded hardware is one of the asm programmers last bastians.
|
|
|
|
|
Hi KiT,
well, if you want to do embedded programming you shouldn't rely too much on the garbage collection, as you've usually very limited resources. So it's a great benefit knowing what is going on in the system and having everthying under control. Otherwise you may be in trouble with running out of resources. So it's very helpful to do some things the hard way, it's usually easier then being effective on managed languages as well.
Bye,
Florian
|
|
|
|
|
hello all. i have a probelm in getting user input during installation wizard.
after getting the values iam trying to store it in a configuration file. using an exe. where the exe contains installer class. i register AfterInstall event in installer class
<br />
void Installer1_AfterInstall(object sender, InstallEventArgs e)<br />
{<br />
XmlDocument configXml = XmlDocument ()<br />
configXml.Load(Application.StartupPath+"\\ConfigurationXML.xml")<br />
XmlNode xmlNd = configXml.SelectSingleNode("//Periperals/MES/Ethernet/IPAddress");<br />
xmlNd.InnerText = Context.Parameters["IP"].ToString();<br />
xmlNd = configXml.SelectSingleNode("//Periperals/MES/Ethernet/Port");<br />
xmlNd.InnerText = Context.Parameters["PORT"].ToString();<br />
xmlNd = configXml.SelectSingleNode("//Periperals/MES/Ethernet/VirtualDirectory");<br />
xmlNd.InnerText = Context.Parameters["WEB"].ToString();<br />
configXml.Save();<br />
}<br />
here IP,WEB,PORT are the inputs that iam getting using the wizard during installation
ConfigurationXML is the xml file where i want to write the user inputs.
but during istallation i getting the following error.
"Exception occured in OnAfterInstall event handler ConfigurationXML.xml not found on the location C:\WINDOWS\system32\ConfigurationXML.xml"
Why it so? i have specified as Application.Startup path right!
|
|
|
|
|
Obviously, the installer's Application.StartupPath must be "C:\WINDOWS\system32", in which case you want something like the Installation Path - which I do not know offhand how you would get from the installer. Someone im sure will answer with that knowledge, but you could search the docs if you're in a hurry.
---
How to get answers to your questions[^]
|
|
|
|
|
How CTI/IVR (Computer telephony integration/interactive voice response) applications can be developed in C# .net 2003. Is C# .net supports Dll like Visual C++ 6.0?
|
|
|
|
|
I think your first step is to some classes or read some books on .NET and C# before asking such a question.
Yes, .NET uses dll's, they are called assemblies.
|
|
|
|