|
Well the reason is simple the exe is a locking program that locks some confidential files from user like data store files on which the whole application depends, now if the exe or the process is terminated, it will unlock the files enabling any body to alter the state of those files...
|
|
|
|
|
That what rights management is there for. Restrict the file access rights to "read only" for all users and there'll be no problems with altered files.
____________________________________
There is no proof for this sentence.
|
|
|
|
|
Its not that simple... any ways... thanks for your suggessions... just found the way...
Regards.
|
|
|
|
|
This is a bad way to protect data, for many reasons:
:: A program that is running all the time adds to the base resource load of the computer.
:: Actively protecting the data is not very secure. A passive protection is much easier to maintain, as it needs no maintainence at all.
:: Hiding an executable requires low level intrusions into the operating system. When it has been used before it has been compared to viruses and trojans.
The best place to hide anything is in plain view. The more you try to hide the data, the more interresting it gets, and it's not really hard to circumvent your protection measures. Just leave the files in the open and use a strong encryption to protect the contents of the files.
---
b { font-weight: normal; }
|
|
|
|
|
Do you really believe that he needs the hidden exe for data protection?
Even if encryption was not enough, he could run his locker-something as a service under local system authority to protect it from "evil users".
____________________________________
There is no proof for this sentence.
|
|
|
|
|
What if the user deletes or corrupts the files... you see you are partailly right... encryption is there in my case as well... but there are other test cases that are to be handled... there are certain levels of security to cope with.
|
|
|
|
|
Waqas Nasir wrote: What if the user deletes
The application that needs the files will not run anymore, so the user will soon undelete the files.
Waqas Nasir wrote: or corrupts the files
Same as above, the application will refuse to run until the files are repaired.
As they are encrypted, the user cannot replace the content with anything that makes sense. Whatever he may write into the files has to be garbage for your application. So you show a message box "currupt installation, please re-install" and the stupid user will learn very quickly not to touch the files.
BTW, why do you expect your users to try everything to destroy an application they are using?
____________________________________
There is no proof for this sentence.
|
|
|
|
|
Waqas Nasir wrote: there are certain levels of security to cope with
Such as?
|
|
|
|
|
Where I work, we use something very similar. but, the data is stored on a DVD and can't be modified. The "tool" you're talking about sits in the system tray. If it goes away for any reason, access to the encrypted data is cutoff.
You're best solution is to put the data on a seperate machine that users have no access to. Your application would talk to this data machine through either web services or custom remoting implementation, in either case, over encrypted communications channels. You also get the benefit of being able to log all accesses to the data too.
The best protection for data is to remove physical access to it...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Waqas Nasir wrote: What if the user deletes or corrupts the files...
What if the user turns off the power? How are you going to stop that?
You can't effectively protect the files from tampering using an active protection. It's easy to just hook up the hard drive as a slave drive on a different computer, then there is no program to protect the files any more.
You can use a CRC or MD5 checksum to protect the data in the files from tampering. If the checksum fails just don't use the data.
---
b { font-weight: normal; }
|
|
|
|
|
Planning to make VIRUS ? ))
|
|
|
|
|
Hello
I added axMediaPlayer control to my project programmatically.
but because of programmatically adding this control i can't access it's "MouseLeave" event, but i can see MouseMove event.
I want this :
<br />
axMediaPlayer.MouseLeave += ...<br />
What should i do ?
|
|
|
|
|
If it's not offered, then it's not offered. You could run a timer in your main window and check Cursor.Position to see if it's over the WMP control or not.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi,
i would suggest you not to use a timer. Use the MouseMove event instead an add something like
<br />
if (<br />
(MouseCursor.X < MediaPlayerControl.Location.X || <br />
MouseCursor.X > MediaPlayerControl.Location.X + MediaPlayerControl.Width) ||<br />
(MouseCursor.Y < MediaPlayerControl.Location.Y ||<br />
MouseCursor.Y > MediaPlayerControl.Location.Y + MediaPlayerControl.Height)<br />
)<br />
{<br />
}<br />
"MouseCursor" has to contain the Position of the MouseCursor of course
Good luck,
mik
|
|
|
|
|
Catch mousemove where ? In the control, or in the surrounding window ? What if the mouse is moved off the control so fast that no mouse move event is fired for the parent window ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ah okay you are right. i did not know that events are not fired under particular circumstances. in this case you would have to use a timer as suggested!
|
|
|
|
|
Hi guys,
This is the method I’ve been trying to use
[DllImport("msi.dll", CharSet=CharSet.Unicode)]
static extern Int32 MsiGetProductInfo(string product, string property, [out] StringBuilder valueBuf, ref Int32 len);
And below is the error I get.
The runtime has encountered a fatal error. The address of the error was at 0x79ef067e, on thread 0xa8c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
I’m trying to find out why I’m getting this error. Does anyone have any idea?
Kulile --- RSA
|
|
|
|
|
Hi!
You'll have to write [Out] instead of [out] (otherwise it doesn't compile here on my machine).
And you'll have to initialize the StringBuilder appropriately:
StringBuilder sb = new StringBuilder(255);
int len = sb.Capacity;
MsiGetProductInfo("{00000000-000.....", "VersionString", sb, ref len);
This works for me...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
hi,
i have a problem with my datagridview,
well not realy a problem, but you know...
if i add a new row, the selected cell is the first row again, and if i have more rows then u can see you dont know if there is one added or not unless you scroll down.
i want my view to be on the last added row instead of the first. how can i do this?
thx
|
|
|
|
|
Hi,
I think setting CurrentCell to some cell of the newly added row will let the DataGridView automatically scroll to this one.
Robert
|
|
|
|
|
this works, thx
index = dataGridView1.Rows.GetLastRow(DataGridViewElementStates.Visible);
dataGridView1.CurrentCell = dataGridView1[0, index];
|
|
|
|
|
Hello,
I am trying to read an XML file and break it up into smaller chunks but am having real problems in doing so as I have never used XML before.
I wish to read a large XML document and cycle through it, copying each record to a new file that I have created (with the relevant header info), until I have 1000 records, then start again. The format of the records is:
<Record>
<attribute1>blah blah</attribute1>
<attribute2>blah blah</attribute2>
<attribute3>blah blah</attribute3>
</Record>
So far I have created the following code:
while (fileReader != null)
{
// Create a file to write to
XmlTextWriter fileWriter = new XmlTextWriter(directory + "\\Output" + x + " myXMLfile.xml", System.Text.Encoding.GetEncoding("ISO-8859-1"));//null);
//fileWriter.WriteStartDocument();
// Write the header details to the new file
fileWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='ISO-8859-1'");
fileWriter.WriteComment("Some commentd");
fileWriter.WriteStartElement("message");
fileWriter.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
fileWriter.WriteAttributeString("xsi", "noNamespaceSchemaLocation", null, "myXSD.xsd");
// Add 'messageHeader' as part of the header
while (fileReader.Name != "messageHeader")
{
fileReader.Read();
}
fileWriter.WriteNode(fileReader, true);
// Write each row to the file, until 1000 records have been written
for (int i = 1; i <= 1001; i++)
{
while (fileReader.Name != "CISKASNRecord")
fileReader.Read();
fileWriter.WriteNode(fileReader, true);
fileWriter.Flush();
}
// Tidy up and close the file so that a new one can be opened
fileWriter.WriteEndElement();
fileWriter.Close();
x++;
}
I can create a new XML file which prints the header info, then begins to cycle through and print the records as expected (hoped!). However, it crashes at the second document with the following error:
"XML document must have a top level element."Error processing resource 'file:///C:/........"
If I increase the size of my for-loop to include all records to see what happens it crashes at the end of the file with the following error:
"The following tags were not closed: message"
I guess this may be the real reason for my errors, however the C# code looks to close all tags so I can't see how this error is appearing? Can anybody help here please?
|
|
|
|
|
You plain cannot do this. Any XML document must have a top level element. In other words, this is XML:
<tag>
<tag1/>
<tag2/>
<tag>
This is not:
<tag1/>
<tag2/>
When you break up your XML, you lose the symmetry of tags, and you are obviously also losing the top level tag.
-- modified at 6:07 Thursday 21st September, 2006
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the reply Christian; however, your code did not appear in your response.
What little I have learnt about XML is the need for a top level element. What is stumping me is the fact that it appears in the first file, but not in the second - yet it is within the loop so for all I can see, should do. As you say, I am losing the top level tag somewhere, but I really don't see where...
|
|
|
|
|
bigove wrote: however, your code did not appear in your response.
Sorry, fixed it.
bigove wrote: What is stumping me is the fact that it appears in the first file, but not in the second
The nature of your code makes it random. Some XML fragments will be broken, some will not. If you're going a tag at a time, the first one will have to fail, it will write the opening top level tag, and by definition will not close it.
You cannot break an XML document into a group of smaller ones, at least not with brute force, or unless you at least add a top level tag to each group and remove it later.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|