|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: May 2010
Messaggi: 161
|
[.net] Avete esperienza di invio Fax con .net?
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. Codice:
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");
}
}
}
Qualcuno ha avuto esperienza in merito? Grazie |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Nov 2005
Città: Texas
Messaggi: 1722
|
Hai controllato questo progetto?
http://www.codeproject.com/Articles/...-with-XP-and-C
__________________
In God we trust; all others bring data |
|
|
|
|
|
#3 |
|
Member
Iscritto dal: May 2010
Messaggi: 161
|
è praticamente il coidce che ho postato io
|
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Nov 2005
Città: Texas
Messaggi: 1722
|
Hai ragione
Non ho provato, ma sembra che debba registrare dei tuoi handlers per ricevere gli eventi dal fax. Un esempio e' in msdn: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
__________________
In God we trust; all others bring data |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 08:31.



















