|
|
Giorgi Dalakishvili wrote: It seems that my previous post has somehow disappeared
The previous post has some extremely badly formed HTML in it somewhere which appears to be messing up things a little.
|
|
|
|
|
But I just used copy/paste for the post which is displayed normally so it should have the same html
|
|
|
|
|
hai all,
I have a requirement to send email through my web application. So far I've used System.Net.Mail no problem, however if the users want to send email to people they are used to knowing only through outlook, how can they do this?
with Regards,
Imthiyas Ahamed.A
|
|
|
|
|
|
I want to move desktop wallpaper left,right,up,down.
How can I do that?
Thank you!
|
|
|
|
|
You can't directly, since the wallpaper positioning options are limited to center, tile or stretch.
However, you could get the current wallpaper, and blit it into a larger bitmap at the desired position, save the new bitmap, and set that as the wallpaper
|
|
|
|
|
|
Hi,
Can anyone help me by explaining the implementation of the below method,
FormsAuthentication.HashPasswordForStoringInConfigFile("password", "SHA1");
since I have to implement the same hashing function in java1.5.
below is my equivalent java code (but it is not returning the same result as .NET counterpart):
public static String encryptPassword(String password)
{
String enyPass;
try
{
MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
messageDigest.update(password.getBytes("UTF8"));
//enyPass = new sun.misc.BASE64Encoder().encode(messageDigest.digest());
enyPass = new BigInteger(messageDigest.digest()).toString(16);
messageDigest.reset();
}
catch(Exception ex)
{
enyPass=null;
}
return enyPass;
}
Thanks in advance,
Regards,
Vythees
|
|
|
|
|
.NET reflector[^] is useful in cases like this - it gives the source as:
public static string HashPasswordForStoringInConfigFile(string password, string passwordFormat)
{
HashAlgorithm algorithm;
if (password == null)
{
throw new ArgumentNullException("password");
}
if (passwordFormat == null)
{
throw new ArgumentNullException("passwordFormat");
}
if (StringUtil.EqualsIgnoreCase(passwordFormat, "sha1"))
{
algorithm = SHA1.Create();
}
else
{
if (!StringUtil.EqualsIgnoreCase(passwordFormat, "md5"))
{
throw new ArgumentException(SR.GetString("InvalidArgumentValue", new object[] { "passwordFormat" }));
}
algorithm = MD5.Create();
}
return MachineKeySection.ByteArrayToHexString(algorithm.ComputeHash(Encoding.UTF8.GetBytes(password)), 0);
}
|
|
|
|
|
Thank you for your help, I managed to replicate the same.
Here is the answer :
-------------
public static String encryptPassword(String password)
{
try {
if(messageDigest == null)
messageDigest = MessageDigest.getInstance("SHA-1");
messageDigest.reset();
messageDigest.update(password.getBytes("UTF8"));
byte[] hash = messageDigest.digest();
StringBuffer hexString = new StringBuffer();
for (int i=0;i
|
|
|
|
|
I am going to send email through the service and I am using System.Net.Mail name space.
This service can run any where in the network.
While connection and sending emails the username and password of the network will be taken from the config file.
How can i use this to set / frame the credentials to send the message.
I got a code in MSDN to set and read the settings, but i don't know how to frame the credentials.
Thanks in advance.
-- modified at 6:07 Thursday 18th October, 2007
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi
take a look at this[^]
greets m@u
|
|
|
|
|
Thank you very much.
But it deals with System.Web.Mail and I am using System.Net.Mail, because System.Web.Mail is obsolete.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Sorry didn't know that i'm still developing with fx 1.1
uhm.. i've taken a look at the fx. 2.0 and there's a class called NetworkCredential in the System.Net namespace that takes a 2-param constructor (new System.Net.NetworkCredential(username,password))
what happens when you assign a NetworkCredential (which is ICredentials) object to the Credential - property of the SmtpClient?
greets
M@u
|
|
|
|
|
Thank you for your timely help.
I have referred MSDN and i am using System.Net.CredentialsCahe class which in turn creates the Network credential what you are referring.
Thank you so much.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi,
How can i read a text file with size in Gig (2 - gig) most efficiently and quickley. Is there anything like reading with the help of structure in C# for Text file.
|
|
|
|
|
|
If i read chunk of data it should be meaningful right? Like It should cut down at end of line only not at middle? Will it do ?
|
|
|
|
|
If you do the chunking you deside where it cuts so you might indeed break it in the middle of a line - or worse, in the middle of a character.
If you have regular newlines (so no line longer than a few hundred megs) you should not have any problem letting ReadLine do the chunking for you.
|
|
|
|
|
OK then probably i should go with ReadLine as it has limited characters per line.
Is there any possibilities to read bulk of lines insted of reading line by line? Some how i want to oncrease throughput of it. Any good suggestion?
|
|
|
|
|
Yes. Do not performance optimize before you know you have a problem - and more importantly where it is. If the bottle neck is IO you can't do much. If the bottleneck is in the code where you process the data, speading up the loading will be a waste of time.
One way you could read more is by reading a larger fixed size chunk, then read forward until you find a line break, but this might not work with all encodings as you might end up thinking the trailing byte of a character is a line break.
|
|
|
|
|
Try
string[] allMyLines = System.IO.File.ReadAllLines("mybigfile.txt");
Do you need this to be able to read your name in from a file?
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hi friemds
I used a port for recieve picture repeatedly. but after a little time my system close the connection. Why? What can I do?
thanks
|
|
|
|
|
Are you using Remoting or plain socket connection ?.
|
|
|
|