Click here to Skip to main content
12,630,137 members (27,880 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
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";
}
Posted 15-Nov-12 5:41am
Updated 15-Nov-12 5:42am
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100