|
My idea would be to NTFS file permissions on those files that need protecting. Set it up so that only the administrator has delete privs. All others would have read and execute?
How to do this from code you would need to do some googling.
|
|
|
|
|
If the user installed your application using Windows Installer (i.e., your Setup project), then they can delete all the files that they want in the Program Files area as long as you follow one simple rule: install the shortcuts to the application through your Setup project and NOT through programmatic means. If you do this, then that shortcut the user clicks on the desktop or in the start menu actually starts a process that checks the manifest for their installed program. If any "Vital" files do not exist, then Windows Installer will automagically replace them! Isn't that nice....
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi
I'm trying to find a way to understand how to know / found out forms/window's class-names.
I need it when I use:
<br />
[DllImport("user32.dll", EntryPoint="FindWindow")]<br />
static extern IntPtr FindWindow(string ClassName, IntPtr WindowName);<br />
For testing purposes I found that winamp's Classname is 'Winamp v1.x'. But how and where do you get to know that? :S
Maybe I'm missing something here, I'd like to know.
Thank you!
Sir Erugor
|
|
|
|
|
|
Thank you very much!
I just use the Spy++ app
Morten Kristensen aka. Sir Erugor
|
|
|
|
|
I have tried the following with no luck. I do not understand why NET RegEx does not handle this RegEx pattern. The pattern checks out fine in Regulator.
string testString = @"c:\temp\test.wav";
// get file extension
string pattern;
pattern = @".+\.[^.]+$";
System.Text.RegularExpressions.Regex regEx;
regEx = new System.Text.RegularExpressions.Regex(pattern);
System.Text.RegularExpressions.MatchCollection matchList;
matchList = regEx.Matches(testString);
string foundString;
foundString = matchList[0].Value;
// the output will be the same as testString: c:\temp\test.wav.
// the desired result is 'wav'
Console.WriteLine(foundString);
Happy Holidays
-- modified at 8:48 Friday 23rd December, 2005
|
|
|
|
|
hi redfish34,
try something like this:
pattern= @"(?<filename>.+)\.(?<extension>[^.]+)$";
then you can access the extension by matchList[0].Groups["extension"].Value
/cadi
24 hours is not enough
|
|
|
|
|
I got a "Unrecognized grouping construct" in both Regulator and VS 2003. But thanks for the effort!
The RegEx i am using came direct from http://www.regexlib.com/ and checks out fine in Regulator, so i do not understand why the NET 1.1 RegEx is not liking it. Maybe this is a bug with NET and i will be forced to parse the extension by hand. It is no big deal, i just don't like all these Microsoft headaches.
|
|
|
|
|
sorry, the braces got lost...
pattern= @"(?<name>.+)\.(?<extension>[^.]+)$";
(i should use preview before posting...)
/cadi
24 hours is not enough
|
|
|
|
|
Your mentioning of groups got me thinking. I tried the following code with my RegEx pattern:
foundString = matchList[0].Groups[1].ToString();
It returns the file extension "wav", which is what i wanted. I guess when one uses a capture expression in a RegEx then one must use groups to access the matches.
Thanks
|
|
|
|
|
there is one other solution using a non capturing group:
(?<=.+\.)[^.]+$
this will have only the extension in the resulting match.
/cadi
24 hours is not enough
|
|
|
|
|
|
you could skip regex and use FileInfo.
FileInfo fi = new FileInfo(filename);
string ext = fi.Extension();
Just an idea. Not sure what would be faster tho.
|
|
|
|
|
I did not notice the "Extension" property of the FileInfo object. That is definitely a better solution. Well, at least i got some RegEx practice from all this. I will be using RegEx extensively in my next project.
|
|
|
|
|
|
How Can I take backup of all table(with data) and store in XML file
Its Urgent plz?
|
|
|
|
|
I dont know if it's possible!
Maybe you should use a serializable file to save the objects..
VentoEngine corp.
Program your life ^^
|
|
|
|
|
You can pull the data you want to back up into a DataSet and then use the GetXml method to convert the Data into Xml.
|
|
|
|
|
Is this possible for entire database.
|
|
|
|
|
Technically yes it is possible. I don't know if its the most efficient solution though. Basically you would have to create a DataTable for each table in your database by quering the records you want to backup and then add the DataTable to the DataSet before you call the GetXml() method.
|
|
|
|
|
But, How to bind the whole database table in dataset, Can u give me any idea or any link...
|
|
|
|
|
Can can we take backup(programatic)of database as well as data of tables and store in XML file
|
|
|
|
|
|
The solution to this problem ( what I understand is):
Go to lable’s property box, then find (DataBindings) tree on the top, open its tree, there you will se (Advanced) property. Select it and click the button on right. It will open a dialog box for “Formatting and Advanced Settings”. Here you will get a combobox naming “Binding”. So from here you can databind your label control.
Sheel Gohe
|
|
|
|
|
im using visual studio 2005 and im writing aspnet
in label properties databindings never been
|
|
|
|