<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C# &amp; Java conversion</title>
	<atom:link href="http://www.kevingao.net/csharp-java-conversion/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kevingao.net</link>
	<description>SourceSafe, Source Control, Software Development</description>
	<lastBuildDate>Fri, 03 Sep 2010 07:42:59 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jalpa</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2575</link>
		<dc:creator>jalpa</dc:creator>
		<pubDate>Tue, 18 May 2010 09:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2575</guid>
		<description>convert this code in c#



import java.util.*;
import javax.activation.DataHandler;
import javax.mail.*;
import javax.mail.internet.*;

public class ReadMultipartMail {

public static void main(String args[]) throws Exception {

String host = “192.168.10.205″;
String username = “komal”;
String passwoed = “komal”;

Properties properties = System.getProperties();
Session session = Session.getDefaultInstance(properties);

Store store = session.getStore(”pop3″);
store.connect(host, username, passwoed);

Folder folder = store.getFolder(”inbox”);

if (!folder.exists()) {
System.out.println(”No INBOX…”);
System.exit(0);
}
folder.open(Folder.READ_WRITE);
Message[] msg = folder.getMessages();

for (int i = 0; i &lt; msg.length; i++) {
System.out.println(&quot;———— Message &quot; + (i + 1) + &quot; ————&quot;);
String from = InternetAddress.toString(msg[i].getFrom());
if (from != null) {
System.out.println(&quot;From: &quot; + from);
}

String replyTo = InternetAddress.toString(
msg[i].getReplyTo());
if (replyTo != null) {
System.out.println(&quot;Reply-to: &quot; + replyTo);
}
String to = InternetAddress.toString(
msg[i].getRecipients(Message.RecipientType.TO));
if (to != null) {
System.out.println(&quot;To: &quot; + to);
}

String subject = msg[i].getSubject();
if (subject != null) {
System.out.println(&quot;Subject: &quot; + subject);
}
Date sent = msg[i].getSentDate();
if (sent != null) {
System.out.println(&quot;Sent: &quot; + sent);
}

System.out.println();
System.out.println(&quot;Message : &quot;);

Multipart multipart = (Multipart) msg[i].getContent();

for (int x = 0; x &lt; multipart.getCount(); x++) {
BodyPart bodyPart = multipart.getBodyPart(x);

String disposition = bodyPart.getDisposition();

if (disposition != null &amp;&amp; (disposition.equals(BodyPart.ATTACHMENT))) {
System.out.println(&quot;Mail have some attachment : &quot;);

DataHandler handler = bodyPart.getDataHandler();
System.out.println(&quot;file name : &quot; + handler.getName());
} else {
System.out.println(bodyPart.getContent());
}
}
System.out.println();
}
folder.close(true);
store.close();
}
}</description>
		<content:encoded><![CDATA[<p>convert this code in c#</p>
<p>import java.util.*;<br />
import javax.activation.DataHandler;<br />
import javax.mail.*;<br />
import javax.mail.internet.*;</p>
<p>public class ReadMultipartMail {</p>
<p>public static void main(String args[]) throws Exception {</p>
<p>String host = “192.168.10.205″;<br />
String username = “komal”;<br />
String passwoed = “komal”;</p>
<p>Properties properties = System.getProperties();<br />
Session session = Session.getDefaultInstance(properties);</p>
<p>Store store = session.getStore(”pop3″);<br />
store.connect(host, username, passwoed);</p>
<p>Folder folder = store.getFolder(”inbox”);</p>
<p>if (!folder.exists()) {<br />
System.out.println(”No INBOX…”);<br />
System.exit(0);<br />
}<br />
folder.open(Folder.READ_WRITE);<br />
Message[] msg = folder.getMessages();</p>
<p>for (int i = 0; i &lt; msg.length; i++) {<br />
System.out.println(&quot;———— Message &quot; + (i + 1) + &quot; ————&quot;);<br />
String from = InternetAddress.toString(msg[i].getFrom());<br />
if (from != null) {<br />
System.out.println(&quot;From: &quot; + from);<br />
}</p>
<p>String replyTo = InternetAddress.toString(<br />
msg[i].getReplyTo());<br />
if (replyTo != null) {<br />
System.out.println(&quot;Reply-to: &quot; + replyTo);<br />
}<br />
String to = InternetAddress.toString(<br />
msg[i].getRecipients(Message.RecipientType.TO));<br />
if (to != null) {<br />
System.out.println(&quot;To: &quot; + to);<br />
}</p>
<p>String subject = msg[i].getSubject();<br />
if (subject != null) {<br />
System.out.println(&quot;Subject: &quot; + subject);<br />
}<br />
Date sent = msg[i].getSentDate();<br />
if (sent != null) {<br />
System.out.println(&quot;Sent: &quot; + sent);<br />
}</p>
<p>System.out.println();<br />
System.out.println(&quot;Message : &quot;);</p>
<p>Multipart multipart = (Multipart) msg[i].getContent();</p>
<p>for (int x = 0; x &lt; multipart.getCount(); x++) {<br />
BodyPart bodyPart = multipart.getBodyPart(x);</p>
<p>String disposition = bodyPart.getDisposition();</p>
<p>if (disposition != null &amp;&amp; (disposition.equals(BodyPart.ATTACHMENT))) {<br />
System.out.println(&quot;Mail have some attachment : &quot;);</p>
<p>DataHandler handler = bodyPart.getDataHandler();<br />
System.out.println(&quot;file name : &quot; + handler.getName());<br />
} else {<br />
System.out.println(bodyPart.getContent());<br />
}<br />
}<br />
System.out.println();<br />
}<br />
folder.close(true);<br />
store.close();<br />
}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jalpa</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2574</link>
		<dc:creator>jalpa</dc:creator>
		<pubDate>Tue, 18 May 2010 09:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2574</guid>
		<description>import java.util.*;
import javax.activation.DataHandler;
import javax.mail.*;
import javax.mail.internet.*;

public class ReadMultipartMail {

    public static void main(String args[]) throws Exception {

        String host = &quot;192.168.10.205&quot;;
        String username = &quot;komal&quot;;
        String passwoed = &quot;komal&quot;;

        Properties properties = System.getProperties();
        Session session = Session.getDefaultInstance(properties);

        Store store = session.getStore(&quot;pop3&quot;);
        store.connect(host, username, passwoed);

        Folder folder = store.getFolder(&quot;inbox&quot;);

        if (!folder.exists()) {
            System.out.println(&quot;No INBOX...&quot;);
            System.exit(0);
        }
        folder.open(Folder.READ_WRITE);
        Message[] msg = folder.getMessages();

        for (int i = 0; i &lt; msg.length; i++) {
            System.out.println(&quot;------------ Message &quot; + (i + 1) + &quot; ------------&quot;);
            String from = InternetAddress.toString(msg[i].getFrom());
            if (from != null) {
                System.out.println(&quot;From: &quot; + from);
            }

            String replyTo = InternetAddress.toString(
                    msg[i].getReplyTo());
            if (replyTo != null) {
                System.out.println(&quot;Reply-to: &quot; + replyTo);
            }
            String to = InternetAddress.toString(
                    msg[i].getRecipients(Message.RecipientType.TO));
            if (to != null) {
                System.out.println(&quot;To: &quot; + to);
            }

            String subject = msg[i].getSubject();
            if (subject != null) {
                System.out.println(&quot;Subject: &quot; + subject);
            }
            Date sent = msg[i].getSentDate();
            if (sent != null) {
                System.out.println(&quot;Sent: &quot; + sent);
            }

            System.out.println();
            System.out.println(&quot;Message : &quot;);

            Multipart multipart = (Multipart) msg[i].getContent();
            
            for (int x = 0; x &lt; multipart.getCount(); x++) {
                BodyPart bodyPart = multipart.getBodyPart(x);

                String disposition = bodyPart.getDisposition();

                if (disposition != null &amp;&amp; (disposition.equals(BodyPart.ATTACHMENT))) {
                    System.out.println(&quot;Mail have some attachment : &quot;);

                    DataHandler handler = bodyPart.getDataHandler();
                    System.out.println(&quot;file name : &quot; + handler.getName());
                } else {
                    System.out.println(bodyPart.getContent());
                }
            }
            System.out.println();
        }
        folder.close(true);
        store.close();
    }
}</description>
		<content:encoded><![CDATA[<p>import java.util.*;<br />
import javax.activation.DataHandler;<br />
import javax.mail.*;<br />
import javax.mail.internet.*;</p>
<p>public class ReadMultipartMail {</p>
<p>    public static void main(String args[]) throws Exception {</p>
<p>        String host = &#8220;192.168.10.205&#8243;;<br />
        String username = &#8220;komal&#8221;;<br />
        String passwoed = &#8220;komal&#8221;;</p>
<p>        Properties properties = System.getProperties();<br />
        Session session = Session.getDefaultInstance(properties);</p>
<p>        Store store = session.getStore(&#8221;pop3&#8243;);<br />
        store.connect(host, username, passwoed);</p>
<p>        Folder folder = store.getFolder(&#8221;inbox&#8221;);</p>
<p>        if (!folder.exists()) {<br />
            System.out.println(&#8221;No INBOX&#8230;&#8221;);<br />
            System.exit(0);<br />
        }<br />
        folder.open(Folder.READ_WRITE);<br />
        Message[] msg = folder.getMessages();</p>
<p>        for (int i = 0; i &lt; msg.length; i++) {<br />
            System.out.println(&quot;&#8212;&#8212;&#8212;&#8212; Message &quot; + (i + 1) + &quot; &#8212;&#8212;&#8212;&#8212;&quot;);<br />
            String from = InternetAddress.toString(msg[i].getFrom());<br />
            if (from != null) {<br />
                System.out.println(&quot;From: &quot; + from);<br />
            }</p>
<p>            String replyTo = InternetAddress.toString(<br />
                    msg[i].getReplyTo());<br />
            if (replyTo != null) {<br />
                System.out.println(&quot;Reply-to: &quot; + replyTo);<br />
            }<br />
            String to = InternetAddress.toString(<br />
                    msg[i].getRecipients(Message.RecipientType.TO));<br />
            if (to != null) {<br />
                System.out.println(&quot;To: &quot; + to);<br />
            }</p>
<p>            String subject = msg[i].getSubject();<br />
            if (subject != null) {<br />
                System.out.println(&quot;Subject: &quot; + subject);<br />
            }<br />
            Date sent = msg[i].getSentDate();<br />
            if (sent != null) {<br />
                System.out.println(&quot;Sent: &quot; + sent);<br />
            }</p>
<p>            System.out.println();<br />
            System.out.println(&quot;Message : &quot;);</p>
<p>            Multipart multipart = (Multipart) msg[i].getContent();</p>
<p>            for (int x = 0; x &lt; multipart.getCount(); x++) {<br />
                BodyPart bodyPart = multipart.getBodyPart(x);</p>
<p>                String disposition = bodyPart.getDisposition();</p>
<p>                if (disposition != null &amp;&amp; (disposition.equals(BodyPart.ATTACHMENT))) {<br />
                    System.out.println(&quot;Mail have some attachment : &quot;);</p>
<p>                    DataHandler handler = bodyPart.getDataHandler();<br />
                    System.out.println(&quot;file name : &quot; + handler.getName());<br />
                } else {<br />
                    System.out.println(bodyPart.getContent());<br />
                }<br />
            }<br />
            System.out.println();<br />
        }<br />
        folder.close(true);<br />
        store.close();<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sunilkumar</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2450</link>
		<dc:creator>sunilkumar</dc:creator>
		<pubDate>Fri, 13 Nov 2009 12:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2450</guid>
		<description>Good Tutorial indeed. Thanks for posting.</description>
		<content:encoded><![CDATA[<p>Good Tutorial indeed. Thanks for posting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSharpJavaMerger Framework To Convert Between Java And C# &#171; Jasper Blog</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2446</link>
		<dc:creator>CSharpJavaMerger Framework To Convert Between Java And C# &#171; Jasper Blog</dc:creator>
		<pubDate>Sun, 08 Nov 2009 15:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2446</guid>
		<description>[...] more: astahostBlog: Kevin.Gao.Blog()Official site: [...]</description>
		<content:encoded><![CDATA[<p>[...] more: astahostBlog: Kevin.Gao.Blog()Official site: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [Java] Achieve interoperability between C# and Java with - DotA Forums</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2433</link>
		<dc:creator>[Java] Achieve interoperability between C# and Java with - DotA Forums</dc:creator>
		<pubDate>Thu, 29 Oct 2009 06:29:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2433</guid>
		<description>[...] public void AddTwoValues() { try { CString strValue1 = m_mainForm.GetFirstTextBoxValue(); CString strValue2 = m_mainForm.GetSecondTextBoxValue(); int iValue1 = strValue1.ToInteger(); int iValue2 = strValue2.ToInteger(); int iResult = iValue1 + iValue2; CString strShowResult = CString.ValueOf(iResult); m_mainForm.ShowResult(strShowResult); CString strSaveResult = new CString(strValue1.GetValue() + &quot; + &quot; + strValue2.GetValue() + &quot; = &quot; + strShowResult.GetValue() + &quot;n&quot;); m_mainForm.SaveResult(strSaveResult); } catch (Exception ee) { m_mainForm.SaveResult(new CString(ee.Message + &quot;n&quot;)); m_mainForm.ShowResult(new CString(&quot;Error&quot;)); } } More info on CSharpJavaMerger:  C# &amp; Java interoperability [...]</description>
		<content:encoded><![CDATA[<p>[...] public void AddTwoValues() { try { CString strValue1 = m_mainForm.GetFirstTextBoxValue(); CString strValue2 = m_mainForm.GetSecondTextBoxValue(); int iValue1 = strValue1.ToInteger(); int iValue2 = strValue2.ToInteger(); int iResult = iValue1 + iValue2; CString strShowResult = CString.ValueOf(iResult); m_mainForm.ShowResult(strShowResult); CString strSaveResult = new CString(strValue1.GetValue() + &quot; + &quot; + strValue2.GetValue() + &quot; = &quot; + strShowResult.GetValue() + &quot;n&quot;); m_mainForm.SaveResult(strSaveResult); } catch (Exception ee) { m_mainForm.SaveResult(new CString(ee.Message + &quot;n&quot;)); m_mainForm.ShowResult(new CString(&quot;Error&quot;)); } } More info on CSharpJavaMerger:  C# &amp; Java interoperability [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Achieve interoperability between C# and Java with CSharpJavaMerger - BizHat Forums</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2432</link>
		<dc:creator>Achieve interoperability between C# and Java with CSharpJavaMerger - BizHat Forums</dc:creator>
		<pubDate>Thu, 29 Oct 2009 06:12:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2432</guid>
		<description>[...] public void AddTwoValues() { try { CString strValue1 = m_mainForm.GetFirstTextBoxValue(); CString strValue2 = m_mainForm.GetSecondTextBoxValue(); int iValue1 = strValue1.ToInteger(); int iValue2 = strValue2.ToInteger(); int iResult = iValue1 + iValue2; CString strShowResult = CString.ValueOf(iResult); m_mainForm.ShowResult(strShowResult); CString strSaveResult = new CString(strValue1.GetValue() + &quot; + &quot; + strValue2.GetValue() + &quot; = &quot; + strShowResult.GetValue() + &quot;n&quot;); m_mainForm.SaveResult(strSaveResult); } catch (Exception ee) { m_mainForm.SaveResult(new CString(ee.Message + &quot;n&quot;)); m_mainForm.ShowResult(new CString(&quot;Error&quot;)); } } More info on CSharpJavaMerger:  C# &amp; Java interoperability [...]</description>
		<content:encoded><![CDATA[<p>[...] public void AddTwoValues() { try { CString strValue1 = m_mainForm.GetFirstTextBoxValue(); CString strValue2 = m_mainForm.GetSecondTextBoxValue(); int iValue1 = strValue1.ToInteger(); int iValue2 = strValue2.ToInteger(); int iResult = iValue1 + iValue2; CString strShowResult = CString.ValueOf(iResult); m_mainForm.ShowResult(strShowResult); CString strSaveResult = new CString(strValue1.GetValue() + &quot; + &quot; + strValue2.GetValue() + &quot; = &quot; + strShowResult.GetValue() + &quot;n&quot;); m_mainForm.SaveResult(strSaveResult); } catch (Exception ee) { m_mainForm.SaveResult(new CString(ee.Message + &quot;n&quot;)); m_mainForm.ShowResult(new CString(&quot;Error&quot;)); } } More info on CSharpJavaMerger:  C# &amp; Java interoperability [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A free C#-Java conversion tool - CodeCall Programming Forum</title>
		<link>http://www.kevingao.net/csharp-java-conversion/comment-page-1#comment-2344</link>
		<dc:creator>A free C#-Java conversion tool - CodeCall Programming Forum</dc:creator>
		<pubDate>Fri, 14 Aug 2009 06:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevingao.net/?page_id=621#comment-2344</guid>
		<description>[...] free C#-Java conversion tool             CSharpJavaMerger is a framework that enables you to write one set of code which can be used both by C# and Java. [...]</description>
		<content:encoded><![CDATA[<p>[...] free C#-Java conversion tool             CSharpJavaMerger is a framework that enables you to write one set of code which can be used both by C# and Java. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
