Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
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";
}
Posted
Updated 15-Nov-12 4:42am
v2

1 solution

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.
 
Share this answer
 
Comments
mostafa358 27-Nov-12 16:10pm    
how to Set the permission ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900