title: Reading lotus notes documents using c#
body: <p>Please check the below  code...is this correct one to read the lotus notes documents(.nsf) files......And i got the console message as "connected"(connected to the server).....</p>
  
  <p>How can I access the items of each document? For example I want subject, who, date, time,...</p>
  
  <p>How can I iterate throug all items of a document?</p>
  
  <p>How can I extract attachments?</p>
  
  <p>Moreover how would i know "is it reads the documents or not"
  what is meaning of reading documents...and after that..we need to export/migrate to sharepoint. Thats is the main bottom line.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using Domino;
  
  namespace ConsoleApplication4
  {
      class Program
      {
          static void Main(string[] args)
          {
              //Creating the notes session and passing password
              NotesSession session = new NotesSession();
              session.Initialize("Sep@2011");
              NotesDatabase NotesDb = session.GetDatabase("vm-domino6", "mts.nsf", false);
  
              if (NotesDb == null)
              {
                  System.Console.WriteLine("Can not connect to server.");
              }
              else
              {
                  System.Console.WriteLine("Connected");
              }
  
              Domino.NotesDocumentCollection col = NotesDb.AllDocuments;
              for (int i = 0; i &lt; col.Count; ++i)
              {
                  Domino.NotesDocument doc = col.GetNthDocument(i);
              }
          }
      }
  }
  </code></pre>