|
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 ?.
|
|
|
|
|
Open it again?
Give us a code sample? Have you put try catches around the receive code? What error messages are given by the client when it tries to send? I have numerous issues when first starting out on sockets - are you recieving asynchronously?
"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."
|
|
|
|
|
I used a code like "peer-to-peer video conferance" in codeproject's sample.
I send 10 images in per seccond and each image is almost 20KB.
I receive an error like this: your machine close the connection perforce.
I think it because of port traffic, but what I can do?
|
|
|
|
|
UserControl is a term used in (at least) ASP.NET, WinForm, and WPF, but at least we got a bit closer.
Based on your other posts I am guessing ASP.NET and then you do indeed need to copy the content into a hidden .NET control from the javascript (as already suggested), but be aware that any content from another site than the site hosting your ASP.NET application will not be available for security reasons.
|
|
|
|
|
No ~
this some code fragment below:
<iframe id="htmlContent" frameborder="0" marginheight="4" marginwidth="4"></iframe><!--container for user-->
<div class="UploadFile" id="UploadFile"></div>
<!--html control-->
<textarea cols="53" rows="3" id="oContent" class="hidden" name="oContent" ></textarea><!--container for server-->
<input type="file" id="oFile" name="oFile" onchange="javascript:oEdit.OnFileLoad();void(0)" class="hidden" />
</div>
<script type="text/javascript" language="javascript" src="Images/htmlEdit.js"></script>
...
<br />
#region Properties & Fields<br />
private string _File;<br />
private string _Content;<br />
public string oFile<br />
{<br />
get { return _File; }<br />
set { _File = value; }<br />
}<br />
public string oContent<br />
{<br />
get { return _Content; }<br />
set { _Content = value; }<br />
}<br />
#endregion
not for security reasons.
//copy the content into a hidden .NET control from the javascript
innerHtml ---> javascript ---> TextBox ---> codebihind ...OK!
main problem is when to do that ?
when another page using the UserControl clicked a button ,we can only see its property "oContent" is ok ?
|
|
|
|
|
|
Image.Save Method[^]
Before posting such simple question you should Search Google and codeproject or check documentation
|
|
|
|
|
How about using the Image.Save method?
|
|
|
|
|
Don't delete your post after it has been answered. That is very rude.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
sorry, but it seems my post was mockery.
|
|
|
|
|
It happens. Just letting you know for future reference, so you don't get flamed
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi all,
im a newbie in C# i need some help.
Create a tag balancing program.
The program must be able to detect missing start and end tags.
hope anyone can give the solution.. as soon as possible...
life is like a cup of coffee.. its pure black.. its up to you on how much coffee cream you pour in to cast away its blackness.
|
|
|
|