<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - C# 2005</title>
		<link>http://p2p.wrox.com</link>
		<description>For discussion of Visual C# 2005.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 15:06:36 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - C# 2005</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>Problem sending mail after publishing site</title>
			<link>http://p2p.wrox.com/c-2005/77102-problem-sending-mail-after-publishing-site.html</link>
			<pubDate>Fri, 20 Nov 2009 09:52:27 GMT</pubDate>
			<description>Hi all,
This code works perfect at local but after publishing the site mail is not coming to the user. plzzz help




Code:
---------
 try
          ...</description>
			<content:encoded><![CDATA[<div>Hi all,<br />
This code works perfect at local but after publishing the site mail is not coming to the user. plzzz help<br />
<br />
<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"> try<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string getattach;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string mailServer = ConfigurationManager.AppSettings[&quot;MailServer&quot;].ToString();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Instantiate a new instance of MailMessage<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MailMessage mMailMessage = new MailMessage();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the sender address of the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.From = new MailAddress(from);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the recepient address of the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.To.Add(new MailAddress(to));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Check if the bcc value is null or an empty string<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((bcc != &quot;&quot;))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the Bcc address of the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.Bcc.Add(new MailAddress(bcc));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Check if the cc value is null or an empty value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (cc!=&quot;&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the CC address of the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.CC.Add(new MailAddress(cc));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the subject of the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.Subject = subject;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the body of the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.Body = body;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the format of the mail message body as HTML<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.IsBodyHtml = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; attach.Length; i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string attach21 = attach[i].ToString();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((attach21.ToString() != null) &amp;&amp; (attach21.ToString() != string.Empty))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; getattach = attach[i];<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.Attachments.Add(new Attachment(getattach));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; getattach = &quot;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the priority of the mail message to normal<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mMailMessage.Priority = MailPriority.High;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Instantiate a new instance of SmtpClient<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SmtpClient mSmtpClient = new SmtpClient();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // mSmtpClient.EnableSsl = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mSmtpClient.Host = mailServer;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; mSmtpClient.Credentials = System.Net.NetworkCredential(&quot;clinim&quot;, &quot;qnool+pu&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  //&nbsp;  mSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Send the mail message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mSmtpClient.Send(mMailMessage);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Label1.Text = &quot;Mail Successfully Send.&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Trace.Write(mMailMessage.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (Exception ex)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //TraceContext tr = new TraceContext();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //tr.TraceMode = TraceMode.SortByCategory;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Trace.Write(ex.Message);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/c-2005-138/">C# 2005</category>
			<dc:creator>raj_yash22</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/c-2005/77102-problem-sending-mail-after-publishing-site.html</guid>
		</item>
		<item>
			<title>Week Number of day, like VB Function DATEPART</title>
			<link>http://p2p.wrox.com/c-2005/77016-week-number-day-like-vbulletin-function-datepart.html</link>
			<pubDate>Fri, 13 Nov 2009 09:56:15 GMT</pubDate>
			<description><![CDATA[Hi, I need help. 
 
I need to get the week number of day,  
 
like the VB Function: 
Code:
---------
 DATEPART("ww", Now())
---------]]></description>
			<content:encoded><![CDATA[<div>Hi, I need help. <br />
 <br />
I need to get the week number of day,  <br />
 <br />
like the <acronym title="vBulletin">VB</acronym> Function: <div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"> DATEPART(&quot;ww&quot;, Now())</code><hr />
</div>I tried this but it does not calculate correctly as when the 1st is on Saterday (week1) &amp; calculates on the 3rd Monday<br />
the below code sees it as still part of week1 &amp; not week 2<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp; WeekOfYear = Convert.ToString(Math.Ceiling(Convert.ToDouble(ManufactureDateVar.DayOfYear) / 7));</code><hr />
</div>I need to somehow replicate the <acronym title="vBulletin">VB</acronym> Function in C# to the correct week number<br />
Please Assist!</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/c-2005-138/">C# 2005</category>
			<dc:creator>ismailc</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/c-2005/77016-week-number-day-like-vbulletin-function-datepart.html</guid>
		</item>
		<item>
			<title>receiving NET SEND messages in an C# application</title>
			<link>http://p2p.wrox.com/c-2005/76923-receiving-net-send-messages-c-application.html</link>
			<pubDate>Thu, 05 Nov 2009 21:50:54 GMT</pubDate>
			<description><![CDATA[Hallo one more time,

I want to store incomming NET SEND messages. 

Storing isn't the problem, but retrieving those messages. I read about older...]]></description>
			<content:encoded><![CDATA[<div>Hallo one more time,<br />
<br />
I want to store incomming NET SEND messages. <br />
<br />
Storing isn't the problem, but retrieving those messages. I read about older functions 'FindWindow' and 'FindWindowEx'. Is this the only way to retrieve (get) a NET SEND message?<br />
<br />
Best regards and thanx in advance.</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/c-2005-138/">C# 2005</category>
			<dc:creator>4thhorseman</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/c-2005/76923-receiving-net-send-messages-c-application.html</guid>
		</item>
	</channel>
</rss>
