请高手赐教

解决方案 »

  1.   

    FAXCOMLib.FaxServer fxsvr = new FAXCOMLib.FaxServer();
                FAXCOMLib.FaxDoc fxdoc = (FAXCOMLib.FaxDoc)fxsvr.CreateDocument(Application.StartupPath + "\\scratch.doc");            try
                {
                    fxsvr.Connect(null); // null for local fax server otherwise a computername
                }
                catch (Exception ex )
                {
                    MessageBox.Show( ex.ToString());
                }            fxdoc.FileName = Application.StartupPath + "\\scratch.doc";
                fxdoc.FaxNumber = theNumber;
                fxdoc.RecipientName = theFaxParty;            try
                {
                    fxdoc.Send();
                }
                catch ( Exception ex )
                {
                    MessageBox.Show( ex.ToString());
                }            fxsvr.Disconnect();If you don't mind doing COM Interop you can leverage the fax service in
    Windows 2000/XP. You start by adding a COM reference to FAXCOM.DLL (usually
    under C:\WINNT\SYSTEM32), then create two objects: FaxServer and FaxDoc.You use the FaxServer object to connect to your server, and then create
    FaxDoc object passing the document you want to fax. At this point you set
    the number to dial, send the fax, and disconnect from the server.You can find the Fax Service Extended COM API documentation here:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxabout_699l.asp
      

  2.   

    Using Windows Fax Service of Windows 2000 in C#http://www.dotnetspider.com/kb/Article680.aspx
      

  3.   

    我想在WINDOWS 2003 下实现,但C:\WINNT\SYSTEM32下没有FAXCOM.DLL,我就从2000系统下拷过来一个,但不知道.NET怎么引用,请赐教
      

  4.   

    工程-引用-右键-添加引用-COM-浏览
      

  5.   

    2003下的控制面板里面有打印机和传真,看看是否那里提供了。本人2003下没有设置过。下面是一段代码
    using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;
    using FAXCONTROLLib;public void FuncName()
    {
    FAXCOMEXLib.FaxServerClass oFaxServerClass = new FAXCOMEXLib.FaxServerClass()
    ;
    oFaxServerClass.Connect("Server Name") //Such As "Damavand";
    FAXCOMEXLib.FaxDocumentClass oFaxDoc = new FAXCOMEXLib.FaxDocumentClass();
    oFaxDoc.Body = MyFileName // Such As @"E:\1.tif";
    oFaxDoc.DocumentName = "Salam";
    oFaxDoc.Recipients.Add("15" , "My Recipient Name");
    oFaxDoc.ConnectedSubmit(oFaxServerClass);
    oFaxServerClass.Disconnect();
    }
      

  6.   

    fxsvr.Connect(null); 
    这过不去,请赐教
      

  7.   

    fxsvr.Connect(null); 
    应改为fxsvr.Connect(FaxServerName);
    FaxServerName用你的机器名就行了
      

  8.   

    using FAXCONTROLLib;
    出错啊!
    是不是应该用
    using FAXCOMLib?
    用FAXCOMLib的话,出异常
    Retrieving the COM class factory for component with CLSID {D73733C8-CC80-11D0-B225-00C04FB6C2F5} failed due to the following error: 80040154.