IT Community - Software Programming, Web Development and Technical Support

How to read inbox messages in windows mobile and create it as a text file using C#?

This is a discussion on How to read inbox messages in windows mobile and create it as a text file using C#? within the Windows Mobile forums, part of the Mobile Software Development category; How to read inbox messages in windows mobile and create it as a text file using C#?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development > Windows Mobile

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-24-2007, 06:24 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Question How to read inbox messages in windows mobile and create it as a text file using C#?

How to read inbox messages in windows mobile and create it as a text file using C#?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2007, 06:42 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: How to read inbox messages in windows mobile and create it as a text file using C

We have to use InTheHand tool for read inbox....we can download the InTheHand tool from 32feet.NET website....

public InTheHand.WindowsMobile.PocketOutlook.OutlookSessi on session = new InTheHand.WindowsMobile.PocketOutlook.OutlookSessi on();
int i = 1;
TextWriter tw = new StreamWriter(@"\My Documents\inbox.txt");
foreach (InTheHand.WindowsMobile.PocketOutlook.SmsMessage smsMessage in session.SmsAccount.Folders["Inbox"])
{
tw.WriteLine("Number :" + i);
tw.WriteLine("From :" + smsMessage.From.Name.ToString());
tw.WriteLine("Date :" + smsMessage.Received);
tw.WriteLine("Body :" + smsMessage.Body.ToString());
tw.WriteLine("");
i++;
}
tw.Close();
MessageBox.Show("File is Created");
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-09-2007, 05:55 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: How to read inbox messages in windows mobile and create it as a text file using C

Hi,
Can we create Xml file for store the values of inbox messages
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-09-2007, 06:31 AM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 246
H2o is on a distinguished road
Wink Re: How to read inbox messages in windows mobile and create it as a text file using C

Hi,

U can create xml file for storing the inbox messages by using third party tool called InTheHand library...

Here code follows,
public InTheHand.WindowsMobile.PocketOutlook.OutlookSessi on session = new InTheHand.WindowsMobile.PocketOutlook.OutlookSessi on();


int i = 1;
XmlTextWriter textWriter = new XmlTextWriter(@"\My Documents\inbox.xml", Encoding.UTF8);
textWriter.WriteStartDocument();
textWriter.WriteComment("<?xml-stylesheet type=text/xsl href=XSLTInbox.xsl?>");
textWriter.WriteStartElement("Inbox");

foreach (InTheHand.WindowsMobile.PocketOutlook.SmsMessage smsMessage in session.SmsAccount.Folders["Inbox"])
{
textWriter.WriteStartElement("Message");

textWriter.WriteStartElement("MessageNo");
textWriter.WriteString(i.ToString());
textWriter.WriteEndElement();

textWriter.WriteStartElement("From");
textWriter.WriteString(smsMessage.From.Name.ToStri ng());
textWriter.WriteEndElement();

textWriter.WriteStartElement("Date");
textWriter.WriteString(smsMessage.Received.ToStrin g());
textWriter.WriteEndElement();

textWriter.WriteStartElement("Body");
textWriter.WriteString(smsMessage.Body.ToString()) ;
textWriter.WriteEndElement();

textWriter.WriteEndElement();
i++;
}
textWriter.WriteEndElement();
textWriter.WriteEndDocument();
textWriter.Close();

MessageBox.Show("Xml File is created");
__________________
H2O

Without us, no one can survive..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-17-2007, 07:42 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Wink Re: How to read inbox messages in windows mobile and create it as a text file using C

Hi,

I have used the above code for create xml file and text file... I have read the message from inbox which has already in inbox... Can we read the messages at the time of received the message to my mobile and have to write in text file using C#..
Can anyone suggest me....
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/windows-mobile/2650-how-read-inbox-messages-windows-mobile-create-text-file-using-c.html
Posted By For Type Date
DiscussWeb IT Community - Fusing This thread Refback 08-09-2007 05:57 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read the text from a .pdf file? vadivelanvaidyanathan Software Testing 0 01-28-2008 10:15 PM
convert Excel file to CSV(or text) file using java mobilegeek Java Programming 2 09-06-2007 06:42 AM
If you Receive error messages when you try to upload a file to an ASP.NET Web page b kingmaker ASP and ASP.NET Programming 1 07-24-2007 12:11 AM
Method in read the file prasath Java Programming 1 07-17-2007 12:12 AM
New T-Mobile phone runs Windows Mobile 6 vadivelanvaidyanathan The Lounge 0 05-22-2007 08:19 AM


All times are GMT -7. The time now is 11:26 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0