Visual Basic.NET
  Home arrow Visual Basic.NET arrow More on Controlling Windows Fax Services U...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

More on Controlling Windows Fax Services Using VB.Net
By: Luke Niland
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2007-07-25

    Table of Contents:
  • More on Controlling Windows Fax Services Using VB.Net
  • What is the Code Doing?
  • Submitting a Job to the Server
  • Explaining the Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    More on Controlling Windows Fax Services Using VB.Net


    (Page 1 of 4 )

    Welcome to the second part of this article about controlling Windows 2003 fax services through a Visual Basic.Net application. In this article, you'll learn how to get some information from a fax server and write it to a text file. You will also learn how to submit a job to a server.

    Background

    If you haven't already done the steps outlined in the first article you will need to complete those before you go any further. If you have already completed them you should have a working Windows 2003 fax server, and a Visual Basic project that can connect to this server using the fxscomex.dll library. At the moment the code we have written does not really do anything very useful; it just proves that we can connect to the server and view/change its properties.

    Now Let's do Something Useful 

    As I just mentioned, the application at the moment won't really do anything useful. Here we are going to write some code that will get some status information off the fax server and write it to a text file. Add a new button to the project, and in its click event, place the following code. What the code is actually doing will be discussed shortly.

    Dim objFaxServer As New FAXCOMEXLib.FaxServer   'Fax server object

    Dim objFaxActivity As FAXCOMEXLib.IFaxActivity 'Fax activity Object

    Dim collFaxDevices As FAXCOMEXLib.FaxDevices   'Fax devices object

    Dim intTotJobCnt As Integer                     'Job and device count

    Dim objBalFileWritter As StreamWriter          'object to write text

     

    'connect to the fax server.

    objFaxServer.Connect("fax-server1")

     

    'work out how many jobs are on the server by adding up the outgoing and queued

    objFaxActivity = objFaxServer.Activity

     

    'Refresh the activity object

    objFaxActivity.Refresh()

     

    'get the current numbers

    intTotJobCnt = objFaxActivity.OutgoingMessages + objFaxActivity.QueuedMessages

     

    'now write it out to the bal file along with the no of modems on this server

    collFaxDevices = objFaxServer.GetDevices

      

    'open the file for writing and put the message into it on a new line

    objBalFileWritter = File.AppendText("c:num_jobs.log")

    objBalFileWritter.WriteLine("Time:" & Now())

    objBalFileWritter.WriteLine("Modems:" & collFaxDevices.Count)

    objBalFileWritter.WriteLine("Total Faxes:" & intTotJobCnt)

    objBalFileWritter.WriteLine("Outgoing: " & objFaxActivity.OutgoingMessages)

    objBalFileWritter.WriteLine("Queued: " & objFaxActivity.QueuedMessages)

    objBalFileWritter.WriteLine("Incoming: " & objFaxActivity.IncomingMessages)

    objBalFileWritter.Close()

    More Visual Basic.NET Articles
    More By Luke Niland


       · Hi,Thanks for this article, I have been trying for several days but I can...
       · Hi,That error does'nt ring any bells, but if you can post the chunk of code thats...
       · Hello,We are getting the same error when trying to attach the "Body" to the fax....
       · Hi, I have never been able to replicate this error. I assume you are getting it when...
       · When my vbs execute the line ConnectSubmit(FaxServer) each document is opened, any...
     

    VISUAL BASIC.NET ARTICLES

    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek