|
Anindya Chatterjee wrote: One thing is not clear to me, if the object is not serializable then how come it is being transferred through the web service?
Probably, the EmailMessage isn't the thing being passed across the wire.
Anindya Chatterjee wrote: Secondly, do any one have any idea on how to store this non serializable object into disk.
Two options (but I don't know the details of EMailMessage , so take with a pinch of salt:
a) Make a serializeable object and write a converter to convert bewteen this andEmailMessage
b) Hand-serialize the object from its properties etc.
That said, the object you have probably contains alot of information needed at runtime and have security implications (which are probably two of the reasons why the object is not marked as serializable). Given there are lots of readonly properties, you won't be able to deserialize EMailMessage , but if you are just interested in storing and retrieving the contents you should be fine.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Does that EmailMessage not have a ToString() and a FromString() method? Since emails are transported as plain ASCII, that should do the thing.
Otherwise, create a serializable object containing all the relevant properties, i.e. message body, to, cc, subject, etc. and serialize that.
|
|
|
|
|
Hi Friends,
I am using a repeater control which have footer. i have placed a asp:label control in the footer.
When i run the page label is showing its value like "1234.00"
but i want to display like "1,234.00".
How to do that.
Thanks in advance.
Regards,
Gourav Tyagi.
|
|
|
|
|
string valueString = string.Format("{0:0,0.00}", myValue);
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Something like this?
using System.Globalization
CultureInfo ci = new CultureInfo("es-ES");
NumberFormatInfo myFormat = ci.NumberFormat;
myFormat.NumberGroupSeparator = ",";
myFormat.NumberDecimalDigits = 2;
string MyFormattedString = MyDoubleValue.ToString("N", myFormat); The endusers' culture should determine how the number is formatted. That's usually configured in the Windows regional settings.
I are Troll
|
|
|
|
|
Hello,
I am creating a directory programatically (C#) to store some application specific data. I want that this directory should't be deleted or modified while the application is running but once the application is closed, it can be modified or deleted. Also, all user on the machine should have similar rights for that folder.
How do I achieve this? Any help in this direction will be greatly appreciated.
Thanks.
|
|
|
|
|
I think this can be achieved with the FileSystemAccessRule class (the creation of the rule(s) that is). Then you create a DirectorySecurity ojbect and use the AddAccessRule method to apply your access rule(s). Finally, create a DirectoryInfo object representing the folder and run the SetAccessControl method which takes your DirectorySecurity object as an argument.
That's pretty much how I've done it in the past. Good luck!
|
|
|
|
|
Thanks for reply.
I am using security like this:
AccessRule rule = new FileSystemAccessRule("Users",
FileSystemRights.Write |
FileSystemRights.ReadAndExecute ,
InheritanceFlags.ContainerInherit |
InheritanceFlags.ObjectInherit,
PropagationFlags.InheritOnly,
AccessControlType.Deny);
Still I am able to delete the folder manually.
Thanks.
|
|
|
|
|
You could open a file (located in the folder) with exclusive read/write, and any attempt to delete the folder will fail as long as that file is opened.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Yeah.. That's good idea.
The only concern is that folder can't be deleted but other containts of the folder can be deleted one by one.
Anyway, this solution might resolve my problem.
Thanks.
|
|
|
|
|
The only thing you can do is be religious about using try/catch blocks and be ready with exception handling for when the user inevitably tries something stupid.
I don't know the nature of your code, so you're going to have to evaluate what's necessary on a case-by-case basis.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
That's odd.. Do you mean that after you apply a rule that deny Users to do something, a member of the very same group is still able to perform whatever it was you wanted to prevent?
|
|
|
|
|
Thanks for reply.
Yes it is allowing to delete with the rule I applied and posted here as well. I might be missing something in the rules but it is allowing.
It might be because I have admin rights on my PC.
Thanks.
|
|
|
|
|
I didn't check your use of flags that thoroughly, but it looked ok. But since you only add the deny rules for the Users group I would assume an Administrator is still able to delete the folder in question.
|
|
|
|
|
Hi guys i got a question for you:
I have created a windows mobile 6 app for a project at school. I have a docked picturebox and the sizemode is set to stretch.
I want to know how i can zoom into my picturebox on a specific area of the image. Like the double tap zoom in some windows mobile 6 applications. I tryed to use the sizemode.zoom but it isn't in there
Any help would be superb
|
|
|
|
|
Hey i dnt know the answer but u maybe got it because ur ques before 3 month plz if u know the answer provide it to me because i neeed it veeeery quickly
thx for ur help
send on this email :
ai_elhakim@hotmail.com
|
|
|
|
|
Hello,
is there any solution to use another control than the standard-WebBrowser-control which is binded by the Internet Explorer?
My favourite is the WebKit, but the Problem is, that in the .NET Wrapper for the WebKit (WebKitDotNet) isn't any way to interact with the page over InvokeScript() and ScriptableObjects and so on...
Is there any way to find a fast and modern WebBrowser-Control, which supports the interaction with the JavaScript of the page?
It would be great if there's something, which is able to run on Mono too.
Thanks for your help =)
|
|
|
|
|
Found this[^] on CP. May be useful to you.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Iam developing a Desktop Based Application. Where user logins into it in Form1. I have to retrvie Information on Logged in Profile Name in Form 6, I have to get the Username in Form6. How to hold the Username, any Solution for it.
As of now iam using a text file and reading from it when required... Please Help me....
|
|
|
|
|
As I understand you are confuse with session on web. There is nothing like session in Desktop Application.
Here you can use OOP fundamental by making entiry(class) of user profile and pass reference to every form where you need it
I know this is not enough but I need more proper description.
Thanks
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
It depends on what kind of app you are producing: multi-machione, or single.
For multiple machines, the obvious solution is to use a small database, if you can install either MSSQL express or MySql on the relevant machines. If not, then consider an XML file via datasets, but be aware that you will have to cope with multi-user problems yourself, if you are using a central repository for several machines.
If it is just multiple persons login in on a single machine, and no networked connection is expected, then I would suggest the App.Config file, or in desperation the Registry.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I want to store Image and retrieve image From Access Database... Please Suggest the Process or else any link so that i will end u with a Solution... And more over what type of Datatype i have to take in Access DB, is it OLEDB or any other.... Thnks
|
|
|
|
|
|
A couple of days ago I asked here how to ensure that a generic list isn't modified while an operation like Find() or Exist() is performed on the list. I was recommended to use the lock-statement.
Now I would like to know if it's enough to lock the list while adding or removing items from it? Or do I need to lock it while performing a non-changing operation like Find() on the list as well?
Thanks for help!
|
|
|
|
|
Hi,
you have to use the lock-statement while adding and removing and also for non-changing operations.
The lock-statement is like a monitor (imagine a gatekeeper) that allows execution of a critical code block. So to be sure if you have several critical blocks that only one block is executed at one time you have to use the same gatekeeper for all blocks.
Example:
<br />
private Object thisLock = new Object();<br />
<br />
public void AddItem(object item) {<br />
lock(thisLock) {<br />
}<br />
}<br />
<br />
public object FindItem(object criteria) {<br />
lock(thisLock) {<br />
}<br />
}<br />
Be pay attention that all access to the list is within a lock-statement using the same object (gatekeeper).
Hope this helps a bit.
Regards
Sebastian
|
|
|
|