Click here to Skip to main content
Rate this: bad
good
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 4:41am
Edited 15-Nov-12 4: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 at 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
0 OriginalGriff 369
1 Sergey Alexandrovich Kryukov 294
2 Maciej Los 270
3 George Jonsson 185
4 PIEBALDconsult 175
0 Sergey Alexandrovich Kryukov 10,934
1 Maciej Los 5,614
2 OriginalGriff 5,603
3 CPallini 3,879
4 BillWoodruff 3,579


Advertise | Privacy | Mobile
Web01 | 2.8.141030.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2014
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