|
Ligblou wrote:
How do I know when a folder is being accessed by the user or application.
You don't. The FileSystemWatcher class will tell you about modifications to the files, not when someone opens them.
Ligblou wrote:
I want to verify with biometric if user can access folder!
Absolutely redundent considering NTFS security already handles this for you, but not using biometric verification. You'd need to write a file system extension to handle this. Your code would have to handle cases where the file is being accessed by a machine with biometric hardware, without biometric hardware, and access from the network, both with and without biometric ahrdware. You'd also have to write utilities to manage the biometric authentication keys. Sound like fun!?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sound like fun!?
It is! The full biometric system is in place. The folder security would be a nice add-on to the package. If I can get this working, I would also have a nice add-on for my multiple layer document encryption package using a HASP (hardware dongle). Loving modularity!!
I also thought about writing a File System Filter Driver (http://www.microsoft.com/whdc/driver/filterdrv/default.mspx[^]) to achieve this. It does seem like the best solution by far. Now, that sounds like fun!
Regards!
|
|
|
|
|
Ligblou wrote:
I would like to disable / remove tabs from the folder properties dialog of Windows Explorer
Depends on the tab your trying to turn off. This is done through group policies, not code. Click Start, pick Run, then type GPEDIT.MSC for the group policy editor.
Ligblou wrote:
Optionally I would also like to add a custom tab.
Never had to do this. But, it would problably be a Shell Extension (Google for this), and would require registry modifications to get the shell to know your extension is there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank your for the information about a Shell Extension - I will look into it.
Regards!
|
|
|
|
|
Hi every body
I wrote an application in Persian language that contains a text editor with RichTextBox.But when I click somewhere on untyped rich textbox area the system language switch between FA(Farsi) to EN ! How can I avoid this behavior or rich text box
|
|
|
|
|
hi, i am trying to read from a text (csv) file and update depending on the changes througth the ui, update certain fields back into the same text (csv) file
i cant find the right tool, or even if it is possible within C#
|
|
|
|
|
I would do it the following way:
1. Read line
2. Split line along the seperators and store it in memory (e.g. store an object containing the values of each line into an arraylist or hashtable)
At this point you have easy access to the information in the file. Depending on file-size, you might want to load "blocks" of information rather than the whole file. Simply display all the info you have and if the user "scrolls" close to the block-end, load the next block.
3. Change the values in memory as needed
4. Using the same seperator, write the file back (linewise).
(If you used blocks, you might have to use a temp-file)
At the lowest level it IS possible to overwrite a few bytes of a file. Usually its not worth the hassle, though, and if you mess up, you might be in trouble.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
I HAve written a chat applicaion on lan.but it chat on single window.
i want to show a new window on each user communication like yahoo or msn messanger.can anybody give me source code for this.or give idea for this.
|
|
|
|
|
Hi.
I have to create some kind of event tracker class, which should register hooking handlers to events. I need a method
RegisterEvent (object target, Delegate handler)
in which I add handler to event (target). Target is probalby System.MulticastDelegate. Is it possible to do that, even when I don't know the event name? I want to avoid changing this method to
RegisterEvent(object target, Delegate handler, string eventName).
All examples that I've found use GetEvent(name) from reflection, and than EventInfo.AddHandler(..)
Pszat
|
|
|
|
|
Hi!
You can use Type.GetEvents() to retrieve all events a type defines, regardless of event names.
The resulting EventInfo[] holds information on the event handler delegate signature, so you can continue from there.
Regards,
mav
|
|
|
|
|
Hi. I’m unfourtunately in this case from Sweden which have the letters å, ä, ö. When I read lines in a textfile using StreamReader I got a “?” symbol when I print these letters. Any idea what to do…
_____________________________
...and justice for all
APe
|
|
|
|
|
You'll have to give the encoding of the file when constructing the StreamReader.
Regards,
mav
|
|
|
|
|
Any Idea of which Encoding I should use. I've tried the regular once.
_____________________________
...and justice for all
APe
|
|
|
|
|
Depends on the encoding that was used to create the file.
You can try Encoding.Default for a start (which is _not_ the same as not specifying an encoding, strangely enough).
Regards,
mav
|
|
|
|
|
Noppe.
I've gone through ASCII, Unicode, Default, snd some more.
Can there be something else that is wrong with my language settings of my CPU? I've shecked that an it is "Swedish".
_____________________________
...and justice for all
APe
|
|
|
|
|
maybe , you need a font file
|
|
|
|
|
Font file...
Sorry I don't understand how I should use that...
_____________________________
...and justice for all
APe
|
|
|
|
|
May sound stupid, but:
Does the font you are using for display have those characters?
If you are using a different encoding, you should get wrong characters, not just question-marks.
Lets say you have a file with ÄäÖö in it. With a wrong encoding, you should get something like JWpM, since there are different chars there. With a wrong font, you will get like "Box","Box","Box","Box" or ????. Windows sees that there is no character in the font for the keycode given and then prints its "standard"-missing-char-in-font symbol.
Try different "standard" fonts (those who come with windows), like "Arial Unicode", "Times", "Verdana", "Arial" ...
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
The file is only a simple txt-file written in Notepad.
I'm writing the text back to a txt-file and eaven to the Console and error appears there too.
I've tried The UTF8Encoding and then the , å, ä, ö doesn't appear at all.
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
If the file was created on a windows system it is likely that it uses windows encoding.
Try the windows-1252 encoding. This works for german pretty well...
/cadi
24 hours is not enough
|
|
|
|
|
You need to know which encoding was used for these letters. It will probably be Windows-1252[^]. The default for StreamReader is UTF-8.
Check a binary view of the file (you can use the arrow to the right of the Open button in VS, select Open With..., then choose Binary Editor) to see what the values of those characters are. If it's 1252, å should be 0xE5 (229), ä should be 0xE4 (228) and ö should be 0xF6 (246). However, it could conceivably be an old DOS/OEM codepage, in which case it's likely to be either 437[^] or 850[^]. In both of these, å = 0x86 (134), ä = 0x84 (132), and ö = 0x94 (148).
If it's something more obscure you may be able to find it at FileFormat.Info[^]. Input the Unicode value of the characters (the hex values I've given for 1252).
When you've worked out what code page you're dealing with, use the following:
StreamReader sr =
new StreamReader(
file,
System.Text.Encoding.GetEncoding(1252)
); Replace 1252 with the correct code page number.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thank You Mike Dimmick and cadi! You made it for me, and my week is saved.
I'll bring up a skoal to you tomorrow evening.
_____________________________
...and justice for all
APe
|
|
|
|
|
I am working on a database application that I call MultiBase. The jist of the application is that it will load a database and create a GUI to interact with it. The application also impliments search and reporting capabilities. The application is currently a winform application, but I plan on implimenting a web interface at a later date.
Currently when I select the database to use my application looks for an associated XML file that defines the controls, associated database fields, etc, to be used to create the GUI. The XML looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<MultiBase xmlns="http://tempuri.org/MultiBase.xsd">
<control>
<controlType>ComboBox</controlType>
<displayText>Manufacture</displayText>
<databaseField>Manufacture</databaseField>
<databaseLookUp>Manufactures</databaseLookUp>
<displayGroup>1</displayGroup>
<displaySubGroup>1</displaySubGroup>
<tabIndex>1</tabIndex>
<toolTip>Select/Enter a manufacturer</toolTip>
</control>
<control>
<controlType>TextBox</controlType>
<displayText>Part Number</displayText>
<databaseField>Part_Number</databaseField>
<databaseLookUp></databaseLookUp>
<displayGroup>1</displayGroup>
<displaySubGroup>2</displaySubGroup>
<tabIndex>2</tabIndex>
<toolTip>Enter part number</toolTip>
</control>
</MultiBase>
In addition to storing the controls to be used in the GUI I want to store the reports that the user has created. The XML would look something like this:
<report>
<reportName>All Records</reportName>
<selectCommand>select * from main</selectCommand>
</report>
Would it be possible (or correct) to store both the controls and the reports in the same XML file (and how do I do that) or use a seperate file for the controls and reports (which would be easy)? I was trying to keep the extra files to a minimum. I would like to have one XML file store both the controls and reports, but I'm unsure as to how to setup the layout and then use the the XmlDocument object to iterate through it (and still keep a well formed document). There is no relation between the controls and reports.
Any thoughts?
Thanks.
Any thoughts?
www.lovethosetrains.com
|
|
|
|
|
You can try some thing like this...
<?xml version="1.0" encoding="utf-8" ?>
<MultiBase xmlns="http://tempuri.org/MultiBase.xsd">
<controls>
<control>
<controlType>ComboBox</controlType>
<displayText>Manufacture</displayText>
<databaseField>Manufacture</databaseField>
<databaseLookUp>Manufactures</databaseLookUp>
<displayGroup>1</displayGroup>
<displaySubGroup>1</displaySubGroup>
<tabIndex>1</tabIndex>
<toolTip>Select/Enter a manufacturer</toolTip>
</control>
<control>
<controlType>TextBox</controlType>
<displayText>Part Number</displayText>
<databaseField>Part_Number</databaseField>
<databaseLookUp></databaseLookUp>
<displayGroup>1</displayGroup>
<displaySubGroup>2</displaySubGroup>
<tabIndex>2</tabIndex>
<toolTip>Enter part number</toolTip>
</control>
</controls>
<reports>
<report>
<reportName>All Records</reportName>
<selectCommand>select * from main</selectCommand>
</report>
</reports>
</MultiBase>
This gives more flexibility, in that you can associate one or more reports to a single form/database...
Hope this helps!!!
<HR><i><b>Regards,
Sidhu</b>
IF YOU DON'T HAVE ANYTHING TO SAY, WELCOME TO THE CLUB</i>
<font color=red>
<a href="http://www.DotnetAtWork.co.nr">Dotnet @ Work</a> Where Dotnet works...</font>
<a href="http://gundavarapu.blogspot.com">My Blog</a>
|
|
|
|
|
Have you seen MyXaml[^]? It does xml object graph instantiation (declarative programming) for generating GUI's, etc., and as a general reflection instantiator, you can create your own classes to support your reporting needs in the same xml file.
Marc
My website
Latest Articles:
Object Comparer
String Helpers
|
|
|
|