|
And what is your question?
What have you tried?
Where are you stuck?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
How can I typecast an object,which is of type SortedList to a SortedList.
public static string UnknownSortedListToStr(object tmp)
{
string res = "";
object n;
object v;
SortedList<object, object> si = (SortedList<object, object>)tmp;
if ((tmp.GetType().FullName.Contains("System.Collections.Generic.SortedList")) ||
(tmp.GetType().BaseType.FullName.Contains("System.Collections.Generic.SortedList")))
{
for (int i = 0; i < si.Count; i++)
{
string s = "";
n = si.Keys[i];
v = si.Values[i];
if (n != null)
s = n.ToString() + "=";
if (v != null)
s += v.ToString();
res += s + "\r\n";
}
}
else throw new Exception("Not a SortedList");
return res;
}
Steve
|
|
|
|
|
Take a look at this[^], particularly the last part of the answer from John Grove.
This[^], particularly Example 40, right near the end.
And finally this blog from Brad Abrahams[^].
One thing they all have in common is that they start with the Type of the collection, and get the parameter types from there. Once you have the types of the parameters, you can go practically anywhere.
You might find other useful/interesting stuff by googling something like reflection generic collections which is how I found the above.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Sound computer advice browsing the web.
I'd already been to 2 of your links but thanks for the effort. When I find the Solution I will be sure to post it.
Steve
|
|
|
|
|
I want to use dynamic background in my winform app, I used GIF image now, it looks not so good, can I use a flash as background? how?
In my opinon, I need to use "AxShockwaveFlash" to play the flash, this object is not under control of my app, so I can't draw on it...
|
|
|
|
|
Embed your flash in a webpage and show it in a WebBrowser [^] control. Set the Dock property to DockStyle.Fill
I are Troll
|
|
|
|
|
But how can I draw some text and image above webbrowser?
|
|
|
|
|
You can drop controls on the webbrowser. Most won't be transparent though.
|
|
|
|
|
Hi all,
Can any one plse tell me the exact use of serialization? in which scenario
we can use it?
Regards
Lijo
|
|
|
|
|
Have you considered "File...Save"?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Honestly, is this[^] really so difficult for you
only two letters away from being an asset
|
|
|
|
|
|
Lijo Rajan wrote: Can any one plse tell me the exact use of serialization? in which scenario
we can use it?
Well, one way that serialisation is really useful is if you want to sell something over a period of weeks. What you do, is run something up to the a point known as the cliff hanger; at this point, you stop and leave people hanging until the next week where you run the next point in the serialisation.
"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
|
|
|
|
|
You may be confusing with this[^].
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Confused? You will be.
"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,
When i click on a button a new mail page is open,
and at the body of the mail i put the text that was writen at richtextbox.
my problem is,
when the new mail page is open the text is writen at the same line.
How can i put the text exactly as it writen at the richtextbox.
here is my code:
<br />
string mailTo = "";<br />
string body = richTextBox2.Text;<br />
string subject = textbox1.text;<br />
<br />
string filename = string.Format("mailto:{0}?subject={1}&body={2}", mailTo, subject, body);<br />
<br />
Process myProcess = new Process();<br />
myProcess.StartInfo.FileName = filename;<br />
myProcess.StartInfo.UseShellExecute = true;<br />
myProcess.StartInfo.RedirectStandardOutput = false;<br />
<br />
myProcess.Start();
10x
|
|
|
|
|
Try using the System.Net.Mail[^] classes, particularly MailMessage.
MailMessage msg = new MailMessage();
msg.From = "from@from.com";
msg.To = mailTo;
msg.Subject = subject;
msg.Body = body;
msg.IsBodyHtml = true;
only two letters away from being an asset
modified on Monday, September 28, 2009 11:54 AM
|
|
|
|
|
Mark Nischalke wrote: msg.BodyFormat = MailFormat.Html;
I don't have BodyFormat at msg object... ![Frown | :(](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_frown.gif)
|
|
|
|
|
It's a property on the MailMessage class, what do you mean you don't have it?
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: It's a property on the MailMessage class, what do you mean you don't have it?
This is what i get on the line-
msg.BodyFormat = MailFormat.Html;
Cannot implicitly convert type 'string' to 'System.Net.Mail.MailAddress'
'System.Net.Mail.MailMessage' does not contain a definition for 'BodyFormat' and no extension method 'BodyFormat' accepting a first argument of type 'System.Net.Mail.MailMessage' could be found (are you missing a using directive or an assembly reference?)
'MailFormat' does not exist in the current context
|
|
|
|
|
My fault the namespace should be System.Net.Mail, not System.Web.Mail and use IsBodyHtml = true
only two letters away from being an asset
|
|
|
|
|
thanks,
can you please tell me how i open this at a new outlook mail?
|
|
|
|
|
Hello to all!
I want to implement in C# the RSA algorithm to encrypt and decrypt some data. I've studiet a lot already about this algorithm, but the only thing that I don't understand how to work with very big numbers in C#, even in C++ or C.
The problem is, that in our days, the recommended minimal lenght of the RSA key is 1024 bits. So, the algorithm says:
* n = pq, where p and q are distinct primes.
* phi, φ = (p-1)(q-1)
* e < n such that gcd(e, phi)=1
* d = e-1 mod phi.
* c = me mod n, 1<m<n.
*="" m="cd" mod="" n.
this="" was="" taken="" from="" here:="" http:="" www.di-mgt.com.au="" rsa_alg.html#note1
so,="" the="" keys="" are="" combination:
cpub="(e," n);
cpriv="(d," n);
well,="" ok,="" lets="" say="" for="" example="" that="" we="" generate="" some="" numbers="" and="" obtain="" keys:
public="" key:="" 3,9312243439
private="" 6208033627,9312243439
the="" algorith="" says="" to="" encrypt="" data,="" you="" need="" do:
c="(m" at="" power="" e)="" then="" do="" (mod="" n),="" or="" in="" c#="" like:="" c="(Math.Pow(m," e))="" %="" n;
to="" decrypt="" data:
m="(C" d)="" d))="" n;
so,="" form="" here="" question:
<b="">How to raise a message, lets say the encrypted '10' to our d, that is 6208033627, to obtain the original message?
And after all, our d is only 33 bits length? Tha maximal System.Double value is some 10 at the 308 power.
What I don't understand? What I'm missing? Can anyone explain me this?
I will apreciate your explanation! Thank you in advance!
|
|
|
|
|
To do anything like these operations in practically any language in use today you will need to get, or write your own, 'big number library'.
There are several around for the .NET languages and a quick Google will find most of them. Be warned though, some are better than others, you'll have to try them, to find one that suits.
I understand that .NET 4.0 has one built in.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
So, the main idea is that really the numbers are raised to a power of 1024 bits? Huh, then this is a problem...
|
|
|
|