|
Decrypt: First, find out the password...
Because they aren't stored as straight text, you can't just read them and identify the words. The files contain heaps of other stuff: font, size, colour, location, lines, boxes, italics, bold, pictures, spreadsheets, etc. etc. etc. If all you are interested in is the text of the document and doing some textual analysis, then the best thing you can do is to throw away as much of the formatting as possible, and save the file as a straight .TXT file from Word and/or PDF. You can then read the whole thing in, and use string.Split (with space and reasonable puncuation) to break it into words.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Or forget about the Pdf and Word ... but how do i gather the words in an array ... in just a text document ...
Thank you
|
|
|
|
|
Use string.split with a blank space as your separator to populate an array of just each individual word.
check out the documentation[^] for more basic string manipulation.
|
|
|
|
|
Each document has a specific structure. Word-documents and PDF files can't be "read", because the computer doesn't know how to read them. Those documents contain extra information like "this part text in bold formatting", and "this in red". All that information is stored in between the words that you see when you open the thing in Word.
CoderForEver wrote: 1. How can I put each words(separated by Space and newline) in to array ... just to know each word (here displaying the content is not necessary)
You can't until you have something to decode the file. You can save Word-files as RTF. Take a look at the result with a text-editor, and you'll see where the extra codes are located. You can also save the file as HTML. Again, a coded form, just like the binary representation.
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: You can save Word-files as RTF
So can I read this RTF file .... then display it on Richtext box ? ... or what is left?
Thnk you for your help
|
|
|
|
|
|
CoderForEver wrote: So can I read this RTF file .... then display it on Richtext box ?
Yup. The same method can be used to read plain text files. If you want to read another format, then you'll have to provide methods to read those formats.
Reading Word-files directly is a fair bit more complex.
I are Troll
|
|
|
|
|
One way to do this would be to use the Index Server IFilter approach and read the words this way, outlined here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi All,
I am writing an application in which I need to put check if a class is user defined or built in (C# or .Net).
Can someone help me with this?
Thanks,
AksharRoop
|
|
|
|
|
This might not be the ideal solution, but you can get the namespace of a type. You could check whether the class part of the "System" or "Microsoft" namespaces
I are Troll
|
|
|
|
|
Thanks but I need better solution if any ..
|
|
|
|
|
There is no way to reliably tell. All classes in the .NET Framework are "user defined".
|
|
|
|
|
hi,
if you write the classes you can use Attribute elements to determinate it.
|
|
|
|
|
You could get the assembly attributes at runtime and check the publisher's name and or copyright notice for 'Microsoft'. Obviously this is not rock solid, but if you want that, the only verifiable way I can think of at the moment is to build a dictionary of all the .NET assemblies and their hash digests (See Assembly.Evidence), then verify the assembly against your dictionary. Not pretty.
|
|
|
|
|
I'm trying to get the Unique Serial Number of an SD (Secure Digital) Memory Card, I know how to get the volume information and the like. From reading the specification for the SD Card, I do know each has such an Unique ID. After doing many search here, google, and other web sites I haven't been able to find the answer.
I want the code in c#
Thanks as always for any help you can provide
|
|
|
|
|
|
|
But what kind of application? The reason I asked it in the first place is because I want to find out whether it's something evil or not
|
|
|
|
|
harold aptroot wrote: evil
Always good to check the motive behind such code. .
So I gave 5 to your messages.
There's nothing left in my right brain and nothing right in my left brain. |
|
|
|
|
|
The official way is to pay sdcard.org significant money every year and they'll give you the information once they have vetted you.
There may be an unofficial way in the form of leaked source code, but considering that such information is under strict NDA, don't expect it to be found easily, or to be reliable if you do find it.
You may be better off finding some other form of security if cost is an issue.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Thanks for reply,
But, I only want to read the UID number no need to edit or delete it.So is there is no way to read UID of memory cards without registering on SDcard.com?
|
|
|
|
|
All such information is considered as the IP of sdcard.com, and is covered by NDA and corporate vetting before release. If you have a legitimate need to access the UID, then you will have to pay for the privelege, and you will have to agree to the terms of their NDA.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Hello,
I am writing C# desktop appplication and I want to store some application specific data which should be accessible to all user with write permission. I am using Environment.SpecialFolder.CommonApplicationData for setting location to write file but I found that the file created in my login is not editable by other user.
Where should I create the file so that it shoul be accessible to all user with write permission?
Regards,
Gajesh
|
|
|
|
|
If you have created the file when you logged in, then the most likely reason it is not accessible to all users is that it is still in use. It will remain in use once you create it until it is disposed. You can try wrapping you access code in "using" blocks, but I suspect you are always going to get problems of file in use if you try to have multiple users capable of writing to it.
Have you considered using a database instead? You may get less problems.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Thanks a lot for reply.
In our application, an XML File is generated when user wants to save some application data from given menu option. These data can be read back to display the information by any logged user. Now, other user should be able to modify the data and save it back. At a time only one user is editing so I think the problem is with the access right (Exception says the same thing: access denied).
Regards,
Gajesh
|
|
|
|