using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Xml;
namespace GetDiscussionTopics
{
class Program
{
public static void Main(string[] args)
{
using (SPSite site = new SPSite("http://serverName/sites/VJTesting/"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists.TryGetList("Team Discussion");
if (list != null)
{
// Empty Query is passed to get only the discussion topics
SPListItemCollection itemColl = list.GetItems(new SPQuery());
foreach (SPListItem item in itemColl)
{
System.Console.WriteLine(item["Title"].ToString());
System.Console.WriteLine(item["Replies"].ToString());
}
System.Console.ReadLine();
}
else
{
System.Console.WriteLine("List does not exists in the site");
System.Console.ReadLine();
}
}
}
}
}
}