|
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
|
|
|
|
|
It doesn't have to be the access permissions - though it is worth checking that your users have the correct access rights to the folder. Have you tried setting it to a shared folder with universal read/write permissions?
The other possibility is that the file is still in use - you will get an access denied for this as well as for incorrect permissions. If you do not dispose of your File object, it may not be destroyed for some considerable time, and during this period it can be in use even if you have closed it. Ensure that all your file access code - including your users - is safely within "using" blocks and you should be ok. Even then, you will probably have to try...catch...wait...retry a few times for safety if you have multiple users writing to a file.
I would still be considering a database rather than an XML file!
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Thanks.
I think it is problem of access permission only. Whenever you create any folder, other user has read only permissions for that folders. So if any other user(from same domain) tries to modify the folder or file within it, it says Access denied. I am trying to create a folder programatically with full control to all user....
How to do it?
Any kind of direction will be great help.
Also, Let me know if i am wrong or need to take some different approach.
|
|
|
|
|
I haven't tried it myself, but look at this.[^]
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
This is what i did and works for me.
bool isModified = false;
DirectoryInfo myDirectoryInfo = new DirectoryInfo("FolderPath");
DirectorySecurity myDirectorySecurity = myDirectoryInfo.GetAccessControl();
AccessRule rule = new FileSystemAccessRule("Users",
FileSystemRights.Write |
FileSystemRights.ReadAndExecute |
FileSystemRights.Modify,
InheritanceFlags.ContainerInherit |
InheritanceFlags.ObjectInherit,
PropagationFlags.InheritOnly,
AccessControlType.Allow);
myDirectorySecurity .ModifyAccessRule(AccessControlModification.Add, rule, out isModified);
myDirectoryInfo .SetAccessControl(myDirectorySecurity );
Thanks to all.
|
|
|
|
|
Hello i want to cut polygone in shape file.I have open a shape file in MapWinGis MapControl and want to splite any selected polygon from the point clicking by mouse.
Help me please......
|
|
|
|
|
Dear all,
i have a xml document:
<config>
<import>
</import>
</config>
now i have to add some nodes inside the import element. the end result most be like this:
<config>
<import>
<company>
<name>MS</name>
<address>address of the company</address>
</company>
</import>
</config>
Thanks in advance.
|
|
|
|