|
hi i keep getting this error:
Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.
below is my code and yes i am trying to do remoting combined wit delegate.
please help me if you can ,thx.
i read about this something http://www.codeproject.com/useritems/RemotingEvent.asp[^]
but i dont use configuration file so how can i set the <formatter ref="soap" typeFilterLevel="Full" />
using System;<br />
<br />
class DelegateDemo<br />
{<br />
delegate String DelegateAbc(String txt);<br />
<br />
public String TestAbc(String txt)<br />
{<br />
Console.WriteLine(txt);<br />
return "Hello from TestAbc";<br />
}<br />
public static String TestStatic(String txt)<br />
{<br />
Console.WriteLine(txt);<br />
return "Hello from TestStatic";<br />
}<br />
static void Main()<br />
{<br />
DelegateDemo t1 = new DelegateDemo();<br />
DelegateAbc d1 = new DelegateAbc(t1.TestAbc);<br />
Console.WriteLine(d1("First call"));<br />
d1 = new DelegateAbc(DelegateDemo.TestStatic);<br />
Console.WriteLine(d1("Second call"));<br />
<br />
cow asdd = new cow();<br />
asdd.setter();<br />
Console.ReadLine();<br />
}<br />
<br />
<br />
<br />
public class moo<br />
{<br />
string data;<br />
<br />
Delegateking abc;<br />
public moo(Delegate lol)<br />
{<br />
abc = (Delegateking)lol;<br />
}<br />
public void set()<br />
{<br />
abc();<br />
}<br />
}<br />
delegate void Delegateking();<br />
public class cow<br />
{<br />
<br />
<br />
moo hihi;<br />
public cow()<br />
{<br />
<br />
Delegateking lala = new Delegateking(this.setter);<br />
hihi = new moo(lala);<br />
}<br />
public void setter()<br />
{<br />
Console.WriteLine("power");<br />
}<br />
}<br />
}
-- modified at 5:08 Friday 11th May, 2007
|
|
|
|
|
I have set my dataconfig file for DB connection using Enterprise Library.
Now i want to use the one of the DBinstance for my Crystal reports connection info.
How can access the dataconfig file from my C# class to obtain the value...
Thanks in Advance
Hema S
|
|
|
|
|
Managed to find.
Any one looking for the same soln here it is..
DatabaseSettings databaseSettings =(DatabaseSettings)ConfigurationManager.GetConfiguration("dataConfiguration");
InstanceData instance =
databaseSettings.Instances["instance name"];
ConnectionStringData connectionString = databaseSettings.ConnectionStrings[instance.ConnectionString];
DatabaseTypeData type = databaseSettings.DatabaseTypes[instance.DatabaseTypeName];
string database=connectionString.Parameters["database"].Value;
similarly you can look for any property u wish to...
Hema S
|
|
|
|
|
The aim is to output double values by using .ToString() or one of its overloads.
<br />
double d = 0.0000001; <br />
Console.WriteLine(d.ToString()); <br />
How can I force the output format to be of a specific type? I'd like to output various double values in a format that always exposes a decimal point: 0.000001 instead of 1E-06
I've already tried .ToString("g") but that only works up to 0.0001.
Many thanks in advance.
Goebel
|
|
|
|
|
Look at the String.Format method!
like:
int numberofdecpoints= 10;
double actualvalue = 0.0000001;
String.Format("{0:F"+ numberofdecpoints.ToString() +"}",actualvalue);
Hope it helps!
All the best,
MArtin
|
|
|
|
|
It's a start, thanks!
Is there a way to store that double value in a string variable using that decimal point format?
Cheers,
Goebel
|
|
|
|
|
String.Format method returns a new string instance.
Or did you mean something else?
All the best,
Martin
|
|
|
|
|
Hoky doky, works all right
First I worked with Console.WriteLine() implicitly using String.Format. Didn't realize that a string was returned though.
Thanks again,
Goebel
|
|
|
|
|
|
Good morning people,
Any idea how to make MS Agent characters listen for commands without having to press the ScrLK "Scroll Lock" button??
Many thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello, good people!
How can I print PDF files from C# code?
What components are required for this task? Are there any free solutions?
Thanks a lot!
|
|
|
|
|
hmm you could use an pdf printer? just an idea, i'm not sure if it is possible
Stef
|
|
|
|
|
Hi,
assuming the PDF extension is associated to a program that can open and print PDF files,
you could use Process.Start() with a ProcessStartInfo.Verb="Print".
|
|
|
|
|
Dear All.
I want to store my data(username and password) in SQL using c#. I want to encrypt the password using C# cryptography. I want to store this encrypted password in database. How? Later I want to decrypt the password while reteriving it from database.
Actually what happens in real time ? How they store password ? Can any one clear my doubt ?
Thanx,
|
|
|
|
|
Mr Perfect wrote: I want to encrypt the password using C# cryptography
Then have a look here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
the plaintex(text to encrypt) will be encrypted to some other format,sothat you cant identify the original text.Its called cipher text.And this is the better way to save passwords in the database.
you can retrieve the orginal text by decrypting the cipher text.
You can use any one of the encryption technique.But you need to decrypt that before use
My small attempt...
|
|
|
|
|
Pwd can be stored using any alogorithm u choose MD5,Sha256 or ur own Algorithm. The encrypted values are soterd to maintain privacy. This algorithm are one-way algorithm so can only be encrypted but cannot be decrypted. So next time when pwd is entered . the code behind will generate the same encryted value that will be matched with the db value.
|
|
|
|
|
nide reply!!!
First and the Foremost: FIGHT TO WIN
About Me
|
|
|
|
|
to store encrypted passwords in a database, you can use salted hash technique.
you can find a lot of articles on this topic if you google for 'salted hash'
regards
|
|
|
|
|
hi i am trying to pass a pointer of an instances as a parameter.
anyone know how to do that it keeps saying something about unsafe context
|
|
|
|
|
C# does not have pointers - just references.
As in the case of the last message I have just replied too
<br />
main()<br />
{<br />
Dog d = new Dog();<br />
Cow c = new Cow(d);<br />
}<br />
This would pass in the instance of Dog (d) into the Cow constructor - the Cow constructor would have to be defined to accept it
<br />
Cow(Dog d)<br />
{<br />
}<br />
|
|
|
|
|
....just for the record you can use pointers but there's always a better way to do it when you are dealing solely with managed code....
|
|
|
|
|
To use pointers in C# you need to create an unsafe class, or an unsafe block. There's really no reason to do so, all classes are passed by ref in C# anyhow.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
But what about value types?
ref and out keywords?
Regards,
Arun Kumar.A
|
|
|
|
|
Have a look at http://www.codeproject.com/dotnet/pointers.asp
|
|
|
|