Library tutorials & articles
How to access Outlook and post to a blog using C#
- Introduction
- Posting to your blog
- Accessing the web service
Accessing the web service
Once the web service is up and working, you need to create a web reference to the webservice, this is done in Visual Studio by right clicking the references box and choosing add web reference. Lets say there's one at http://webservices.nullify.net/blog.asmx
When you add a web reference Visual Studio will automatically produce a wrapping class that will allow you to easily instantiate the web service as a local object, without worrying about any of the underlying technology. (I'll only cover synchronous calls here, otherwise this will turn into a full fledged book...)
To access the above web service, you would simply define it as a new object:
net.nullify.webservices.Blog blog = new net.nullify.webservices.Blog();
And you would define our NewsItem scructure that we defined in the webservice:
net.nullify.webservices.NewsItem article = new net.nullify.webservices.NewsItem();
This will allow you to now call methods of the blog object, which will execute directly on your web server, with all the rights of a normal ASP.NET page - including the ability to insert articles into your database!
Using our imaginary webservice, rather than writing the subject for each MailItem to the console, you can post them to your blog. So, going back to our original loop that went through all the mail items in a particular Outlook folder:
foreach(Outlook.MailItem t in inboxFld.Items)
{
article.subject = t.Subject; article.content = t.Body; article.topic = "OutlookPost"; blog.AddArticle(article);
}
I hope this post helps someone!
Related articles
Related discussion
-
Help please for student
by mandy130 (0 replies)
-
Loop help needed
by BKRoberts (5 replies)
-
Problem after strong naming an assembly
by rinkurathor1 (0 replies)
-
Regarding User control creation in C# .Net(Windows Application)
by porchelvi (0 replies)
-
Access Database Refreshing
by ranjithmadawala (0 replies)
Related podcasts
-
Looking into the C# Crystal Ball with Charlie Calvert and Bill Wagner
One of the most exciting announcements from PDC was the news about C# 4.0 and Visual Studio 2010. With all the excitement and discussion throughout the event about these new developer tools, we reached out to two experts in the fields. Charlie Calvert and Bill Wagner sat down with Keith and Woody...
Events coming up
-
Dec
6
Developing AJAX Web Applications with Castle Monorail
London, United Kingdom
Monorail is the model-view-controller engine of the Castle Project, bringing many of the best ideas of Ruby on Rails to the .NET world. In this talk, David De Florinier and Gojko Adzic show how Monorail makes it easy to develop .NET based AJAX applications, and how to use the Castle Project to build Web 2.0 applications effectively. Come to this session if you are a .NET web developer. Everyone is welcome!
I am working for fetching contacts from outlook express. I have explored a lot , But I couldn't .
How can I get access microsoft outlook express's conatacts?
Is this possible?
Hii Friends,
This is kumar, I facing the following problm. If Any body knows the solution please pass the solution to my E-Mail Id.
Query: How To Dynamically Pass The .aspx Page Values Into an .Html Page In ASP.NET + C#. Here I am Passing more than one value. I dont want to write hard code.
Query: I am writing the code for getting the data from database. In this data i have images. Then i have to pass these images to web page. Its like a banner Engine. But, Here i dont wont to take a "adrotator". I had taken a Html Iframe control. Then I have to pass the image name throuth src. Then i had verified and got the required images through database comparisons. When i run the application i have to display the web like "http://wepage1.aspx/sample.html". In this sample.html page is the dynamic page. When u run the web page ".aspx" that time i need to display/ pass these wepage image values to .html(sample.html) page.
How this is possible? If anybody knows the solution please pass the solution to my ID
Thnx and Regards
Naresh Kumar
ravuri_naresh@yahoo.co.in
hello,
I want somre help from u.we are using check boxes in datagrid for activating and deactivating.how to put that
check boxes in datagrid and reflect changes in database
thank you,
MohanVarma.
This thread is for discussions of How to access Outlook and post to a blog using C#.