在ASP中使用FaxModem拨号发送传真 [英] Send Fax With FaxModem Dial UP In ASP

查看:85
本文介绍了在ASP中使用FaxModem拨号发送传真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在ASP中使用调制解调器发送传真
我使用此代码发送传真,
我的问题是我在本地(Visual Studio)中发送传真
上传网站并发送传真时,我看到此错误
"ConnectAccess被拒绝.(来自HRESULT的异常:0x80070005(E_ACCESSDENIED))-11等待操作超时.(来自HRESULT的异常:0x80070102)"
并且根文件的权限被允许给任何用户

I want to send fax with modem in ASP
an i use this code to send fax,
my problem is I send the fax in Local(Visual Studio)
when upload the site and i want to send fax,I see this Error
"ConnectAccess is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))--11The wait operation timed out. (Exception from HRESULT: 0x80070102)"
and the permission of the root file is Allowed to any user

public void FaxDocument(String TheFile, string faxnumber)
{
   FAXCOMLib.FaxServer server = new FaxServerClass();
    FAXCOMLib.FaxDoc doc = null;
    int response = -11;

    try
    {
        server.Connect(Environment.MachineName);
    }
    catch(Exception e)
    {
        lbl.Text +="-Connect"+ e.Message;
        //System.Console.WriteLine("1"+e.Message);
    }

    try
    {
        doc = (FAXCOMLib.FaxDoc)server.CreateDocument(TheFile);
    }
    catch(Exception e)
    {
        lbl.Text += "-doc error" + e.Message;
        //System.Console.WriteLine("doc error"+e.Message);
    }

    try
    {
        doc.FaxNumber = faxnumber;
        doc.RecipientName = "Test";
        doc.DisplayName = "work";
    }
    catch(Exception e)
    {
        lbl.Text += "assignments" + e.Message;
        //System.Console.WriteLine("assignments" + e.Message);
    }


    try
    {

        response = doc.Send();
        Process myProcess = new Process();
        if (Process.GetProcessesByName("AcroRd32").Length > 0)
        {
            myProcess = Process.GetProcessesByName("AcroRd32")[0];
            if (DateTime.Now.Ticks - myProcess.StartTime.Ticks > TimeSpan.FromSeconds(1).Ticks)
                myProcess.Kill();
        }
    }
    catch(Exception e)
    {
        lbl.Text +="-"+ response + e.Message;
        //System.Console.WriteLine( response + e.Message);
    }

    try
    {
        server.Disconnect();
    }
    catch(Exception e)
    {
        lbl.Text += "disconnect" + e.Message;
        //System.Console.WriteLine("2"+e.Message);
    }
    lbl.Text += "Successful";
}

推荐答案

ASP不是ASP.NET.我认为您的服务器上存在权限问题.如果在本地工作,则您的问题是未在服务器上正确配置dll,或者ASP.NET进程没有运行该DLL的权限.
ASP is not ASP.NET. I think you have a permissions issue on your server. If it works locally, then your issue is that the dll is not configured right on the server, or the ASP.NET process does not have permission to run it.


这篇关于在ASP中使用FaxModem拨号发送传真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆