DEVBUZZ Homepage .NET CF Newsreader using IP*Works!
 
Web www.devbuzz.com
  HOME PAGE
  All Articles
  Advertise
  Consulting

 Development
  Discuss - Forums
  Still in the box?
  .Compact Framework
  Code Snippets
  SQL Server CE
  Database
  MS Resources
 Stores
  Developer Controls
  Pocket PC Hardware
  Pocket PC Software
  Pocket PC Books
  .NET CF Books
  Book Reviews
  SPB SW Discounts
  RESCO SW Discounts
 DEVBUZZ Info
  About Us
  Help
  Join our email list
  Links & Ratings
  Press & Comments
  Pocket PC version
  Software Reviews
  Hardware Reviews
 Authors
  Authors
  Article Guide
  Competitions
 Resources
  Developers
  Register
  Login

  SPB Discounts!
 Columnists
  Rick Winscot
 Past Blast
  Personal Media Ctr
  Gizmobility
  eVB Legacy
  Old news
  Hosted Software
  Wireless
  Newsletters
  Carl Davis
  Upton Au

 Pocket PC Registry
  Join the registry
  View current list
 Current Poll
Are you converting to .NET Compact Framework?
Yes, it has changed my life!
No, I'm sticking with eVB
.NET CF what's that`?

Current results
3431 votes so far
 Recent Forum Threads [goto forums]

Get Computername
read... (67 hits)


Great aid to development productivity
read... (82 hits)


ThreadingTimer sample code
read... (143 hits)


Multithreading with .NET CF
read... (194 hits)


Moving from eMbedded Visual Basic to Visual Basic .NET
read... (166 hits)


.NET Compact Framework 2.0 Service Pack 2
read... (226 hits)


Transfer Data from SQL Server 2000 to SQL Server Compact Edition
read... (298 hits)


This protocol version is not supported
read... (236 hits)


Converting Lowercase to uppercase wont work
read... (203 hits)


Direct access to MS SQL Server 2000
read... (374 hits)


Creating SDF file in Desktop
read... (513 hits)


Winsock in CF.NET
read... (316 hits)


Using Pocket Outlook to submit HTML page form with MAILTO action
read... (420 hits)


Missing file "System.Data.PocketPC.asmmeta.dll"
read... (268 hits)


HP iPAQ hw6915 Serial Port Issue
read... (309 hits)


Info on the recent forum changes
read... (341 hits)


SqlServer tools from Redgate
read... (383 hits)


Arrow keys and Hardware navigation button
read... (393 hits)


O2 XDA lls pin sync cable to comport
read... (322 hits)


Creating dynamic folders on Pocket PC OS
read... (299 hits)

Custom Windows Mobile software development.
LBS Challenge 2007
LBS Challenge Eight previous NAVTEQ Global LBS Challenge® participants have received venture capital funding and nine past LBS Challenge winners have launched commercial applications on major wireless carriers. Register your non-commercial LBS application in the 2007 NAVTEQ Global LBS Challenge in one of three regions: Americas, Europe-Middle East-Africa (EMEA) or Asia-Pacific(APAC). You could win a share of $2 million in prizes. This could be your year.
Dream. Develop. Win.

Development | .NET Compact Framework

.NET CF Newsreader using IP*Works!
Written by Lance Robinson  [author's bio]  [read 30544 times]
Edited by Derek

Download the code   Discuss this article   .NET Compact Framework   

Page 1  Page 2 

The world of today demands mobility. Consumers want to be online everywhere they go - whether it be in the home or office, in the car on a road trip, or even at the beach.

Using IP*Works!, developers can easily give their embedded applications the power of connectivity. Your embedded applications can manage files remotely with the FTP, HTTP, or RCP components. With IP*Works! its easy to read email or news online with the IMAP, POP, or NNTP components. Writing proprietary client applications becomes a very simple task when using the IPPort TCP/IP client component. Extremely fast Zip, Gzip, Tar, and Jar compression/decompression and archiving capabilities are made possible with the IP*Works! Zip toolkit. Secure credit card processing can be performed with just a few lines of code using IP*Works! CC. All of this power can make your embedded applications true mobile connected applications.

Today's embedded developers have the choices of what development environment to use, what language to use, and what components to use. VS.Net device applications take advantage of the .Net Compact Framework to create applications that will run on any Windows CE or Pocket PC device, regardless of what processor its using. The device just has to have the Compact Framework installed. Some developers prefer to work with the Embedded Visual Tools products, the most popular of which being version 3. EVT V3 included eVB and eVC++. eVC++ V4 is also available.

IP*Works! provides product suites for all of these environments. Even better, a secure IP*Works! SSL edition is also available for Pocket PC 2002 developers.

.NET Compact Framework Edition Fully-managed .NET Components
ActiveX Edition for Pocket PC 2002 32 bit ActiveX Controls
ActiveX Edition for Pocket PC 2000 32 bit ActiveX Controls
ActiveX Edition for HPC 2000 32 bit ActiveX Controls
SSL ActiveX Edition for Pocket PC 2002 32 bit ActiveX Controls
C++ Edition for Pocket PC 2002 32 bit C++ Classes
C++ Edition for Pocket PC 2000 32 bit C++ Classes
C++ Edition for HPC 2000 32 bit C++ Classes
C++ Edition for Smart Phone 32 bit C++ Classes
.NET Compact Framework Edition Fully-managed .NET Components
SSL .NET Compact Framework Edition Fully-managed .NET Components
Zip .NET Compact Framework Edition Fully-managed .NET Components
IM .NET Compact Framework Edition Fully-managed .NET Components
CC .NET Compact Framework Edition Fully-managed .NET Components

 

One important goal of embedded development is to give devices the power to do anything that can be done on a desktop. Leveraging IP*Works! enables developers to do this.

Take the case of news browsing: On the desktop, this is an easy thing to do. There are many powerful news browsers available - but that is not the case for devices. The fact is that with IP*Works!, creating a news reader for embedded devices is relatively trivial. The most difficult part is not the internet communication, but arranging the articles by thread. One way to handle that threading is to use the treeview control.

Download Articles From News Server

Newsgroup articles are kept on the news server in order of arrival, not in order of message thread or subject. Rather than display articles this way, I'll of course want to "thread" these messages so that replies will fall under their parent message in that nice threaded tree view that we're all accustomed to.

I don't want to download all of the articles at once - or even one article. Instead, I am just going to download a list of article headers. In order to download these article headers, as well as other information about a range of articles, use the NNTP object's GroupOverview method. This method will ask the news server for information about all of the articles specified in the OverviewRange. For this example, I'll just download the 100 most recent messages.

Nntp1.NewsServer = "msnews.microsoft.com"
Nntp1.CurrentGroup = "microsoft.public.dotnet.framework.compactframework"
Nntp1.OverviewRange = CStr(Nntp1.LastArticle - 100) & "-" & Nntp1.LastArticle
Nntp1.GroupOverview() Nntp1.Disconnect()

The GroupOverview method will begin downloading article information from the news server. For each message, a GroupOverview event will fire. This event returns with the following parameters:

ArticleNumber number of the article within the group
Subject the subject of the article
From email address of the article author
ArticleDate date the article was posted
MessageId unique message id for the article
References message ids for the articles this article refers to (separated by spaces)
ArticleSize size of the article in bytes
ArticleLines the number of lines in the article
OtherHeaders other article headers that NewsServer provides for the article

It is within this event that we will begin to build a tree of articles, each branch representing a different thread. We will do this by using the MessageId and References headers provided here.

The Message-ID header uniquely identifies each nntp article. Here are 5 message-ID sample values:

<e8ZlPf8rCHA.1132@TK2MSFTNGP12>
<vARP9.2130$L61.370841@news1.west.cox.net>
<OKG$Dr8rCHA.2484@TK2MSFTNGP10>
<KV_P9.4450$9N5.440007@newsread2.prod.itd.earthlink.net>
<3E1086F3.2050805@.com>

The References header contains the message-ID's of all of the preceeding messages in the thread. This means that the first message in a thread does not have a References header, since there were no messages before it in the thread. Only replies will have a References header. In this way, a "chain" is created, linking each message to its "parent".

For example, consider a new message, the first in its thread, posted by Tom B. Since this is the first message in the thread, it will not contain a references header.

Next, Sally C replies to Tom's message. Her article will contain a references header containing the message-ID from Tom's message.

Next, John D replied to Sally. His references header has the value of Sally's reference header, plus Sally's message-ID.

Finally, Mike E posts a second reply to Tom's original message. Just like Sally's message, his reference header contains only a reference to Tom's message.

[original message from Tom B.] From: Tom B. Subject: This is a new thread about smurfs Message-ID: <abc123@mynetwork.com> [Sally C replies to Tom B., includes a ref to his message] From: Sally C. Subject: Re[1]: This is a new thread about smurfs Message-ID: <abc456@othernetwork.com> References: <abc123@mynetwork.com> [John D. replies to Sally C., inc Sally's ref and msgid] From: John D. Subject: Re[2]: This is a new thread about smurfs Message-ID: <abc789@thatnetwork.com> References: <abc123@mynetwork.com>, <abc456@othernetwork.com> [Mike E. replies to Tom B., includes only a ref to his msg] From: Mike E. Subject: Re[1]: This is a new thread about smurfs Message-ID: <def123@thisdomain.com> References: <abc123@mynetwork.com>

Next Page 

Back to .NET Compact Framework | [Article Index]

 

Back to the top of the page.
Chris De Herrera's Windows CE Website Windows CE News & Information Source
Copyright ©2000-2007 by DEVBUZZ.COM, Inc., NJ. USA.MSDEVELOP