MaxDembo81
16-10-2012, 11:39
Salve,
avrei la necessità di inviare fax tramite un programma scritto in c#/vb.net
Ho visto che si deve referenziare FAXCOMLIB per l'invio del fax e devo dire che facendo una prova sono riuscito a mandarne uno.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using FAXCOMLib;
namespace Fax
{
public partial class Form1 : Form
{
public void FaxDocument(String TheFile, string faxnumber)
{
FAXCOMLib.FaxDoc doc = null;
int response = -11;
try
{
FS.Connect(Environment.MachineName);
}
catch (Exception e)
{
System.Console.WriteLine("1" + e.Message);
}
try
{
doc = (FAXCOMLib.FaxDoc)FS.CreateDocument(TheFile);
}
catch (Exception e)
{
System.Console.WriteLine("doc error" + e.Message);
}
try
{
doc.FaxNumber = faxnumber;
doc.RecipientName = "Test";
doc.DisplayName = "work";
}
catch (Exception e)
{
System.Console.WriteLine("assignments" + e.Message);
}
try
{
response = doc.Send();
}
catch (Exception e)
{
System.Console.WriteLine(response + e.Message);
}
try
{
FS.Disconnect();
}
catch (Exception e)
{
System.Console.WriteLine("2" + e.Message);
}
System.Console.WriteLine("w00t");
}
private void button1_Click(object sender, EventArgs e)
{
this.FaxDocument("C:\\Users\\max\\Desktop\\test.txt", "xxxx");
}
}
}
Ora il problema è che io vorrei sapere se poi questo fax è stato inviato o meno e, soprattutto, inviarne grosse quantità (creerà problemi?).
Qualcuno ha avuto esperienza in merito? Grazie
avrei la necessità di inviare fax tramite un programma scritto in c#/vb.net
Ho visto che si deve referenziare FAXCOMLIB per l'invio del fax e devo dire che facendo una prova sono riuscito a mandarne uno.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using FAXCOMLib;
namespace Fax
{
public partial class Form1 : Form
{
public void FaxDocument(String TheFile, string faxnumber)
{
FAXCOMLib.FaxDoc doc = null;
int response = -11;
try
{
FS.Connect(Environment.MachineName);
}
catch (Exception e)
{
System.Console.WriteLine("1" + e.Message);
}
try
{
doc = (FAXCOMLib.FaxDoc)FS.CreateDocument(TheFile);
}
catch (Exception e)
{
System.Console.WriteLine("doc error" + e.Message);
}
try
{
doc.FaxNumber = faxnumber;
doc.RecipientName = "Test";
doc.DisplayName = "work";
}
catch (Exception e)
{
System.Console.WriteLine("assignments" + e.Message);
}
try
{
response = doc.Send();
}
catch (Exception e)
{
System.Console.WriteLine(response + e.Message);
}
try
{
FS.Disconnect();
}
catch (Exception e)
{
System.Console.WriteLine("2" + e.Message);
}
System.Console.WriteLine("w00t");
}
private void button1_Click(object sender, EventArgs e)
{
this.FaxDocument("C:\\Users\\max\\Desktop\\test.txt", "xxxx");
}
}
}
Ora il problema è che io vorrei sapere se poi questo fax è stato inviato o meno e, soprattutto, inviarne grosse quantità (creerà problemi?).
Qualcuno ha avuto esperienza in merito? Grazie