On windows Server 2003 have capabilities act as fax server. so many client can be sending the document with fax service via this server. but on windows XP professional also have fax service like on server 2003 but not richeest functional like on server 2003. on windows XP You must active this service via add and remove windows component on control panel.
Like on microsoft office , The app have feature for sending document via email or fax service. on this post we can add that capabilities into .net project. The project use windows xp proffesional for replace windows 2003 server.
Before started this project we must make sure fax service installed on Computer. because the project need component from that service. on the work sheet visual studio 2008 add the reference FAXCOMEXlib.dll into project. The source code like below
-
Public Class Form1
-
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
-
With cd
-
.ShowDialog()
-
TextBox5.Text = cd.FileName
-
End With
-
End Sub
-
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
TextBox1.Text = My.Computer.Name.ToString
-
End Sub
-
Private Sub sending()
-
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
-
Dim objFaxServer As New FAXCOMEXLib.FaxServer
-
Dim objSender As FAXCOMEXLib.FaxSender
-
Dim jobid As Int32
-
If TextBox1.Text = "" Or TextBox2.Text = "" Then
-
MsgBox("Please input server name and destination number !", MsgBoxStyle.Critical, "Faxing")
-
Exit Sub
-
End If
-
Try
-
objFaxServer.Connect("")
-
objFaxDocument.Body = TextBox5.Text
-
objFaxDocument.DocumentName = "Reliez "
-
objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH
-
objFaxDocument.Recipients.Add(TextBox2.Text, TextBox3.Text)
-
objFaxDocument.Sender.Company = "Reliez "
-
objFaxDocument.Sender.StreetAddress = "Http:" & "//" & "reliez.net"
-
objFaxDocument.Sender.SaveDefaultSender()
-
objFaxDocument.ConnectedSubmit(objFaxServer)
-
System.Threading.Thread.Sleep(5000)
-
objFaxServer.Disconnect()
-
Me.Close()
-
Catch ex As Exception
-
MsgBox(ex.ToString)
-
'MsgBox("Fail to Send Document !", MsgBoxStyle.Critical, "Fax")
-
End Try
-
End Sub
-
End Class
Download complete source code click this link

1 komentar:
Free Fax Server
Post a Comment