PDA

View Full Version : نحوه ی ارسال و دریافت فکس در سی شارپ



negar84
دوشنبه 12 تیر 1385, 13:31 عصر
سلام
چطور می تونم از طریق مودم فاکس دریافت و ارسال کنم ... البته با یه برنامه c#
لطفا یه لینکی ، ebook یا هر راهنمایی دیگه
ممنون می شم
bye

dot_net_lover2
دوشنبه 12 تیر 1385, 13:55 عصر
فقط کافی است هر چیزی که میخوای FAX کنی را به Printer مربوط به سرویس FAX ماکروسافت ارسال کنی.

negar84
دوشنبه 12 تیر 1385, 15:46 عصر
شرمنده می شه بیشتر توضیح بدین ....
این کاری که گفتید رو چطوری انجام بدم؟
ممنون

dot_net_lover2
جمعه 16 تیر 1385, 22:27 عصر
یکی از سرویس های مربوط به Windows به نام MS FAX Service پس از نصب یک Printer به لیست پرینترهای شما اضافه میکند .
حال شما در هر جا که نیاز به FAX کردن پیدا کردید ، فقط کافی است عملیات Print را انجام داده با این تفاوت که Fax Printer را انتخاب میکنید.
اول این Refrence را به پروژه خود اضافه کنید
FAXCONTROLLib

کد چک کردن اینکه آیا این سرویس بر روی Windows نصب میباشد یا نه


using FAXCONTROLLib;
.
.
.
public FaxControlClass fsCheck = new FaxControlClass();
.
.
.
if (fsCheck.IsFaxServiceInstalled)
{
taskItem1.Text = "Fax service installed.";
taskItem1.Enabled = false;
}
else
{
taskItem1.Text = "Fax service not installed.";
btnFax.Enabled = false;
}

اینم کد نصب این سرویس


fsCheck.InstallFaxService();

negar84
شنبه 17 تیر 1385, 17:06 عصر
ممنون از جوابتون ...
می شه بگید چطور عملیات print رو انجام بدم..

M.GhanaatPisheh
یک شنبه 18 تیر 1385, 15:43 عصر
جواب دوست عزیزمون کاملا درسته
کافیه یه کم راجع بهش توی MSDN جستجو کنید.
کامپوننتهایی رو هم که خواسته بودید :
http://www.interfax.net/scripts/dev.asp?ref=g531
http://www.topshareware.com/RFax-for-.NET-download-19025.htm
http://www.java4less.com/fax_dotnet.htm

دو مساله :
1- سوالات فنی خود تون رو توی محیط عمومی انجمن مطرح کنید.
2-برای استفاده از این Componentها درخواست Crack یا امثالهم نفرمائید.

موفق باشید.

pooyansystem
شنبه 28 بهمن 1385, 18:12 عصر
جناب dot_net_lover2 میشه لطفا کد رو به صورت کامل بذارید من می خوام از کد راهنمایی شما استفاده کنم ولی نمی دونم چه طور؟

dot_net_lover2
یک شنبه 29 بهمن 1385, 22:49 عصر
دوست عزیز کد گویا هست ٬ ما بقی ماجرای ارسال فکس به پرینت گرفتن سند مربوط به وسیله پرینتر تعریف شده به نام فکس منتهی میشود.

pooyansystem
دوشنبه 30 بهمن 1385, 10:00 صبح
من بازم متوجه منظورتون نشدم من تازه کارم اگه ممکنه کامل توضیح بدید و اگه ممکنه با کد

dot_net_lover2
دوشنبه 30 بهمن 1385, 10:09 صبح
پس شما اول مطالعاتی در مورد نحوه استفاده از پرینتر انجام دهید بعد اگه باز مشکلی بود سئوال کنید.

pooyansystem
شنبه 05 اسفند 1385, 12:22 عصر
سلام

بچه ها من موقع ارسال fax با KDtele با مشکل زیر مواجه میشم چرا و چه طور رفعش کنم؟
Error: Fax Time out: no response was received in the expected time

در ضمن اینم بگم که من Timeout مربوط به KDPhon رو تغییر دادم بازم همین مشکل رو داشتم

dot_net_lover2
شنبه 05 اسفند 1385, 13:08 عصر
چرا واسه Fax از سرویس خود ویندوز استفاده نمیکنی ؟

pooyansystem
شنبه 05 اسفند 1385, 17:22 عصر
چون می خوام از سایر امکانات KDtele استفاده کنم

بچه ها خواهش می کنم یکی یه جوابی بهم بده من خیلی به این جواب احتیاج دارم

pooyansystem
یک شنبه 06 اسفند 1385, 11:31 صبح
چرا هیچکس جواب نمیده یعنی تا حالا هیچکس با یه همچین مشکلی برخورد نکرده؟

pooyansystem
پنج شنبه 10 اسفند 1385, 12:23 عصر
خوب من همچنان منتظرم

اصلا کسی تا حالا با این کامپوننت دچار مشکل شده یا نه

من تو مثالAnsweringMachin هم با مشکل رو به رو شدم

بچه هایی که با این کامپوننت کار کردید یه راهنمایی بکنید دیگه:گریه:

arashhatami
پنج شنبه 10 اسفند 1385, 23:48 عصر
این موضوع قبلا یه بار گفته شده بود اماخوب منم واست تکرارمی کنم(با اجازه ارائه دهندتاپیک در گذشته)




FaxControlClass fschk = new FaxControlClass();
if (fschk.IsFaxServiceInstalled)
{
label1.Text = "Fax Services Is Instaled";
}
else
{
label1.Text = "Fax Services IS Not Instaled";
}
البته refrance FAXCONTROLLib رو Import کن و بعد ای کها رورارد کن

pooyansystem
شنبه 12 اسفند 1385, 07:59 صبح
جناب arashhatami اگه دقت می کردید من گفتم با KDtele مشکل دارم و نمی خوام از سرویس خود ویندوز واسه ارسال فکس استفاده کنم

mnoruzi
پنج شنبه 23 فروردین 1386, 08:54 صبح
bache ha recive ro che joori mishe handel kard???ino kasi midoone?age begid mamnoon misham

dot_net_lover2
پنج شنبه 23 فروردین 1386, 11:56 صبح
فکس های دریافت شده در پوشه ای ذخیره میشوند ، میتونی اونا رو فراخوانی کنی و نمایش بدی.

مهدی رحیم زاده
شنبه 25 فروردین 1386, 06:42 صبح
میشه یه نمونه برنامه ساده آموزشی بزارین ...

dot_net_lover2
سه شنبه 28 فروردین 1386, 13:56 عصر
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FAXCONTROLLib;
using Microsoft.Office.Core;
using System.Diagnostics;
using System.IO;
namespace ITD_FS
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
public FaxControlClass fsCheck = new FaxControlClass();
private XPExplorerBar.Expando expando2;
private XPExplorerBar.Expando expando3;
private XPExplorerBar.TaskPane taskPane1;
private XPExplorerBar.Expando expando1;
private XPExplorerBar.TaskItem taskItem1;
private XPExplorerBar.Expando expando4;
private XPExplorerBar.TaskItem taskItem2;
private XPExplorerBar.TaskItem taskItem3;
private XPExplorerBar.TaskItem taskItem4;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.Button btnContact;
private System.Windows.Forms.Button btnFax;
private System.Windows.Forms.Button btnAbout;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.PrintDialog printDialog1;
// the way to handle parameters you don't care about in .NET
public object missing = System.Reflection.Missing.Value;
public object myTrue = true; // Print in background
public object myFalse = false;
public frmMain()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
this.expando2 = new XPExplorerBar.Expando();
this.taskItem1 = new XPExplorerBar.TaskItem();
this.expando3 = new XPExplorerBar.Expando();
this.taskPane1 = new XPExplorerBar.TaskPane();
this.expando1 = new XPExplorerBar.Expando();
this.taskItem2 = new XPExplorerBar.TaskItem();
this.taskItem3 = new XPExplorerBar.TaskItem();
this.taskItem4 = new XPExplorerBar.TaskItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.expando4 = new XPExplorerBar.Expando();
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnSearch = new System.Windows.Forms.Button();
this.btnContact = new System.Windows.Forms.Button();
this.btnFax = new System.Windows.Forms.Button();
this.btnAbout = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.printDialog1 = new System.Windows.Forms.PrintDialog();
((System.ComponentModel.ISupportInitialize)(this.e xpando2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.e xpando3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.t askPane1)).BeginInit();
this.taskPane1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.e xpando1)).BeginInit();
this.expando1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.e xpando4)).BeginInit();
this.expando4.SuspendLayout();
this.SuspendLayout();
//
// expando2
//
this.expando2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.expando2.Animate = true;
this.expando2.CustomSettings.WatermarkAlignment = System.Drawing.ContentAlignment.MiddleRight;
this.expando2.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando2.Location = new System.Drawing.Point(12, 12);
this.expando2.Name = "expando2";
this.expando2.TabIndex = 0;
this.expando2.TitleImage = ((System.Drawing.Image)(resources.GetObject("expando2.TitleImage")));
//
// taskItem1
//
this.taskItem1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem1.BackColor = System.Drawing.Color.Transparent;
this.taskItem1.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.taskItem1.Image = null;
this.taskItem1.Location = new System.Drawing.Point(16, 40);
this.taskItem1.Name = "taskItem1";
this.taskItem1.Size = new System.Drawing.Size(152, 16);
this.taskItem1.TabIndex = 0;
this.taskItem1.Text = "taskItem1";
this.taskItem1.Click += new System.EventHandler(this.taskItem1_Click_1);
//
// expando3
//
this.expando3.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando3.Location = new System.Drawing.Point(336, 296);
this.expando3.Name = "expando3";
this.expando3.TabIndex = 1;
this.expando3.Text = "expando3";
//
// taskPane1
//
this.taskPane1.AutoScrollMargin = new System.Drawing.Size(12, 12);
this.taskPane1.Dock = System.Windows.Forms.DockStyle.Fill;
this.taskPane1.Expandos.AddRange(new XPExplorerBar.Expando[] {
this.expando1,
this.expando4});
this.taskPane1.Location = new System.Drawing.Point(0, 0);
this.taskPane1.Name = "taskPane1";
this.taskPane1.Size = new System.Drawing.Size(656, 462);
this.taskPane1.TabIndex = 1;
this.taskPane1.Text = "taskPane1";
this.taskPane1.Click += new System.EventHandler(this.taskPane1_Click);
//
// expando1
//
this.expando1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.expando1.Animate = true;
this.expando1.CustomSettings.WatermarkAlignment = System.Drawing.ContentAlignment.MiddleRight;
this.expando1.ExpandedHeight = 120;
this.expando1.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando1.Items.AddRange(new System.Windows.Forms.Control[] {
this.taskItem1,
this.taskItem2,
this.taskItem3,
this.taskItem4,
this.pictureBox1});
this.expando1.Location = new System.Drawing.Point(12, 12);
this.expando1.Name = "expando1";
this.expando1.Size = new System.Drawing.Size(632, 120);
this.expando1.TabIndex = 0;
this.expando1.Text = "Information";
this.expando1.TitleImage = ((System.Drawing.Image)(resources.GetObject("expando1.TitleImage")));
this.expando1.StateChanged += new XPExplorerBar.ExpandoEventHandler(this.expando1_St ateChanged);
//
// taskItem2
//
this.taskItem2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem2.BackColor = System.Drawing.Color.Transparent;
this.taskItem2.CustomSettings.FontDecoration = System.Drawing.FontStyle.Regular;
this.taskItem2.Image = null;
this.taskItem2.Location = new System.Drawing.Point(456, 64);
this.taskItem2.Name = "taskItem2";
this.taskItem2.Size = new System.Drawing.Size(112, 16);
this.taskItem2.TabIndex = 1;
this.taskItem2.Text = "taskItem2";
//
// taskItem3
//
this.taskItem3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem3.BackColor = System.Drawing.Color.Transparent;
this.taskItem3.CustomSettings.FontDecoration = System.Drawing.FontStyle.Regular;
this.taskItem3.Image = null;
this.taskItem3.Location = new System.Drawing.Point(456, 40);
this.taskItem3.Name = "taskItem3";
this.taskItem3.TabIndex = 2;
this.taskItem3.Text = "taskItem3";
//
// taskItem4
//
this.taskItem4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem4.BackColor = System.Drawing.Color.Transparent;
this.taskItem4.CustomSettings.FontDecoration = System.Drawing.FontStyle.Regular;
this.taskItem4.Image = null;
this.taskItem4.Location = new System.Drawing.Point(456, 88);
this.taskItem4.Name = "taskItem4";
this.taskItem4.Size = new System.Drawing.Size(112, 16);
this.taskItem4.TabIndex = 3;
this.taskItem4.Text = "Clock";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(576, 56);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(48, 48);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchIma ge;
this.pictureBox1.TabIndex = 4;
this.pictureBox1.TabStop = false;
//
// expando4
//
this.expando4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.expando4.Animate = true;
this.expando4.ExpandedHeight = 300;
this.expando4.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando4.Items.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.btnSearch,
this.btnContact,
this.btnFax,
this.btnAbout,
this.label1,
this.label2,
this.label3,
this.label4,
this.label5,
this.label6,
this.label7,
this.label8});
this.expando4.Location = new System.Drawing.Point(12, 144);
this.expando4.Name = "expando4";
this.expando4.Size = new System.Drawing.Size(632, 300);
this.expando4.TabIndex = 1;
this.expando4.Text = "FAX Document";
this.expando4.TitleImage = ((System.Drawing.Image)(resources.GetObject("expando4.TitleImage")));
this.expando4.StateChanged += new XPExplorerBar.ExpandoEventHandler(this.expando4_St ateChanged);
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox1.ForeColor = System.Drawing.SystemColors.WindowText;
this.textBox1.Location = new System.Drawing.Point(16, 64);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(504, 21);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
//
// btnSearch
//
this.btnSearch.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Image = ((System.Drawing.Image)(resources.GetObject("btnSearch.Image")));
this.btnSearch.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnSearch.Location = new System.Drawing.Point(528, 64);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(96, 21);
this.btnSearch.TabIndex = 1;
this.btnSearch.Text = "Browse";
this.btnSearch.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
//
// btnContact
//
this.btnContact.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnContact.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnContact.Image = ((System.Drawing.Image)(resources.GetObject("btnContact.Image")));
this.btnContact.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnContact.Location = new System.Drawing.Point(528, 176);
this.btnContact.Name = "btnContact";
this.btnContact.Size = new System.Drawing.Size(96, 40);
this.btnContact.TabIndex = 2;
this.btnContact.Text = "FAX Info";
this.btnContact.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnContact.Click += new System.EventHandler(this.btnContact_Click);
//
// btnFax
//
this.btnFax.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnFax.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFax.Image = ((System.Drawing.Image)(resources.GetObject("btnFax.Image")));
this.btnFax.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnFax.Location = new System.Drawing.Point(528, 112);
this.btnFax.Name = "btnFax";
this.btnFax.Size = new System.Drawing.Size(96, 40);
this.btnFax.TabIndex = 3;
this.btnFax.Text = "Send FAX";
this.btnFax.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnFax.Click += new System.EventHandler(this.btnFax_Click);
//
// btnAbout
//
this.btnAbout.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnAbout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAbout.Image = ((System.Drawing.Image)(resources.GetObject("btnAbout.Image")));
this.btnAbout.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnAbout.Location = new System.Drawing.Point(528, 240);
this.btnAbout.Name = "btnAbout";
this.btnAbout.Size = new System.Drawing.Size(96, 40);
this.btnAbout.TabIndex = 4;
this.btnAbout.Text = "About Us";
this.btnAbout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 128);
this.label1.Name = "label1";
this.label1.TabIndex = 5;
this.label1.Text = "Number of pages :";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 160);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(112, 23);
this.label2.TabIndex = 6;
this.label2.Text = "Number of sections :";
//
// label3
//
this.label3.Location = new System.Drawing.Point(16, 192);
this.label3.Name = "label3";
this.label3.TabIndex = 7;
this.label3.Text = "Spelling Errors :";
//
// label4
//
this.label4.Location = new System.Drawing.Point(16, 224);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(112, 23);
this.label4.TabIndex = 8;
this.label4.Text = "Grammatical Errors :";
//
// label5
//
this.label5.Location = new System.Drawing.Point(136, 128);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(312, 23);
this.label5.TabIndex = 9;
//
// label6
//
this.label6.Location = new System.Drawing.Point(136, 160);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(312, 23);
this.label6.TabIndex = 10;
//
// label7
//
this.label7.Location = new System.Drawing.Point(136, 192);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(312, 23);
this.label7.TabIndex = 11;
//
// label8
//
this.label8.Location = new System.Drawing.Point(136, 224);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(312, 23);
this.label8.TabIndex = 12;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// frmMain
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(656, 462);
this.Controls.Add(this.taskPane1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "frmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n;
this.Text = "ITD-FS :: IT Developers - Fax Service";
this.Closing += new System.ComponentModel.CancelEventHandler(this.frmM ain_Closing);
this.Load += new System.EventHandler(this.frmMain_Load);
((System.ComponentModel.ISupportInitialize)(this.e xpando2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.e xpando3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.t askPane1)).EndInit();
this.taskPane1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.e xpando1)).EndInit();
this.expando1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.e xpando4)).EndInit();
this.expando4.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmMain());
}
private void frmMain_Load(object sender, System.EventArgs e)
{
if (fsCheck.IsFaxServiceInstalled)
{
taskItem1.Text = "Fax service installed.";
taskItem1.Enabled = false;
}
else
{
taskItem1.Text = "Fax service not installed.";
btnContact.Enabled = false;
btnFax.Enabled = false;
}
DateConvertor myConvertor = new DateConvertor();
taskItem2.Text = DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString();
taskItem3.Text = myConvertor.ShamsiCompleteStringDate(DateTime.Now. Year,DateTime.Now.Month,DateTime.Now.Day);
}
private void taskItem1_Click(object sender, System.EventArgs e)
{
//fsCheck.InstallFaxService();
}
private void taskPane1_Click(object sender, System.EventArgs e)
{

}
private void expando4_StateChanged(object sender, XPExplorerBar.ExpandoEventArgs e)
{

}
private void expando1_StateChanged(object sender, XPExplorerBar.ExpandoEventArgs e)
{

}
private void timer1_Tick(object sender, System.EventArgs e)
{
taskItem4.Text = DateTime.Now.ToShortTimeString();
}
private void btnAbout_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process myProcess = new Process();
myProcess.StartInfo.RedirectStandardOutput=false;
myProcess.StartInfo.FileName=Application.StartupPa th.ToString() + "\\" + "ITDevelopers.exe";
myProcess.StartInfo.UseShellExecute=true;
myProcess.Start();
myProcess.Dispose();
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
Word.ApplicationClass WordApp = new Word.ApplicationClass();
OpenFileDialog myBrowser = new OpenFileDialog();
myBrowser.Filter = "Microsoft Word files (*.doc)|*.doc";
//myBrowser.ShowDialog();
if (myBrowser.ShowDialog() == DialogResult.OK)
{
textBox1.Text = myBrowser.FileName;


// give any file name of your choice.
object fileName = myBrowser.FileName;
object readOnly = true;
object isVisible = true;

// Make word visible, so you can see what's happening
//WordApp.Visible = true;
// Open the document that was chosen by the dialog

Word.Document aDoc = WordApp.Documents.Open(ref fileName,
ref missing, ref readOnly, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
// compute number of document page
Word.WdStatistic stat = Word.WdStatistic.wdStatisticPages;
int num = aDoc.ComputeStatistics(stat, ref missing);
//
// MessageBox.Show(num.ToString());
// MessageBox.Show(aDoc.GrammaticalErrors.Count.ToStr ing());
// MessageBox.Show(aDoc.Sections.Count.ToString());
// MessageBox.Show(aDoc.SpellingErrors.Count.ToString ());
label5.Text = num.ToString();
label6.Text = aDoc.Sections.Count.ToString();
label7.Text = aDoc.SpellingErrors.Count.ToString();
label8.Text = aDoc.GrammaticalErrors.Count.ToString();

//This two line clear WINWORD.EXE process from processes list
aDoc.Close(ref myFalse, ref missing, ref missing);

}
WordApp.Quit(ref myFalse, ref missing, ref missing);
}
private void btnContact_Click(object sender, System.EventArgs e)
{

System.Diagnostics.Process myProcess = new Process();
myProcess.StartInfo.RedirectStandardOutput=false;
myProcess.StartInfo.FileName=System.Environment.Sy stemDirectory.ToString()+"\\"+"fxsclnt.exe (file://\\)";
myProcess.StartInfo.UseShellExecute=true;
myProcess.Start();
myProcess.Dispose();

}
private void btnFax_Click(object sender, System.EventArgs e)
{
if (textBox1.Text.Length > 0)
{
Word.ApplicationClass WordApp = new Word.ApplicationClass();
System.Drawing.Printing.PrintDocument myDoc = new System.Drawing.Printing.PrintDocument();
PrintDialog pd = new PrintDialog();
pd.Document = myDoc;
//pd.ShowDialog();
if (pd.ShowDialog() == DialogResult.OK)
{
//////////////////////////////////////////////////////////////////////////////////

// give any file name of your choice.
object fileName =textBox1.Text;
object readOnly = true;
object isVisible = true;

// Make word visible, so you can see what's happening
//WordApp.Visible = true;
// Open the document that was chosen by the dialog

Word.Document aDoc = WordApp.Documents.Open(ref fileName,
ref missing, ref readOnly, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
// compute number of document page
Word.WdStatistic stat = Word.WdStatistic.wdStatisticPages;
int num = aDoc.ComputeStatistics(stat, ref missing);
///////////////////////////////////////////////////////////////////////////////////////
// Set the active printer
WordApp.ActivePrinter = pd.PrinterSettings.PrinterName;

// Using PrintOutOld to be version independant
WordApp.ActiveDocument.PrintOutOld(ref myTrue,
ref myFalse, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref myFalse, ref missing, ref missing, ref missing);

// Make sure all of the documents are gone from the queue
while (WordApp.BackgroundPrintingStatus > 0)
{
System.Threading.Thread.Sleep(250);
}

//This two line clear WINWORD.EXE process from processes list
aDoc.Close(ref myFalse, ref missing, ref missing);

}
WordApp.Quit(ref myFalse, ref missing, ref missing);
}
else
{
MessageBox.Show("You should choose a file to send.");
}
}
private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//WordApp.Quit(ref myFalse, ref missing, ref missing);
}
private void taskItem1_Click_1(object sender, System.EventArgs e)
{
fsCheck.InstallFaxService();
Application.Exit();
}
}
}



این کد یک فایل با پسوند doc را انتخاب و ارسال میکند.

Esy_Programmer
سه شنبه 02 مرداد 1386, 13:18 عصر
از دوست عزیزم آقای dot_net_lover2 تشکر می کنم.

withoutnews
جمعه 05 مرداد 1386, 15:58 عصر
i have this problem already!!
نمی دونم چکار کنم

asgari2005
شنبه 03 شهریور 1386, 14:57 عصر
سلام من از کامپوننت KDTele در C#.net استفاده می کنم می خواهم بفهم که چطوری می شه از ارسال یا دریافت فکس زمانی که fail میشه متوجه شد یعنی اینکه چه تعداد از صفحات ارسال و ما بقی fail شدن و من بعد از صفحه ای که به درستی ارسال شده دوباره فکس را ارسال کنم

mina1363
شنبه 03 شهریور 1386, 15:12 عصر
شما این کامپوننت رو از کجا تهیه کردید؟

asgari2005
شنبه 03 شهریور 1386, 21:08 عصر
اگر توی وب سایت جستجو کنی می تونی مطالبی خوبی در مورد این کامپوننت پیدا کنی
من فعلا دنبال کرک این کامپوننت هستم شما می تونی نسخه اصلی رو از خوده وب سایت شرکتش دانلود کنی http://www.kaed.com

مهدی رحیم زاده
یک شنبه 25 شهریور 1386, 23:30 عصر
سلام
کسی می تونه در مورد دریافت و ارسال فکس برام یه توضیح کامل بده ...
چیزایی که توی جست و جو پیدا کردم زیاد به دردم نخوردن ...
هم در مورد ارسال با استفاده از امکانات ویندوز و هم جز اون ...
یا توضیح بدین و یا یه نمونه برنامه واسه راهنمایی برام بزارین ...
اگر این کار رو بکنید خیلی کمک بزرگی به من کردین ...
ممنون

allameh
شنبه 28 مهر 1386, 16:40 عصر
سلام دوستان چطور میشه با FAXCOMLib فکس فرستاد البته من یک پروژه در codeproject دیدم که error میده شما هم بررسی کنید ببینید میتونید حل کنید یا نه


اینم کد نمونه:

کد زیر خطا میدهد
FAXCOMLib.FaxServer Server = new FAXCOMLib.FaxServerClass();



FAXCOMLib.FaxDoc doc = new FAXCOMLib.FaxDoc();
int response = -1;
try
{
Server.Connect(Environment.MachineName);
}
catch { }
try
{
doc = (FAXCOMLib.FaxDoc)Server.CreateDocument("d:\\tiffile.rtf");
}
catch { }
try
{
doc.FaxNumber = "102";
doc.RecipientName = "Test";
doc.DisplayName = "work";
}
catch
{


}
try
{
response = doc.Send();
}
catch { }

try
{
Server.Disconnect();
}
catch { }
}

amindiary
دوشنبه 28 آبان 1386, 11:13 صبح
سلام
من می خوام یک برنامه ای بنویسم که یک فایل ( تکست، عکس ) رو بگیره و فکس کنه به شماره ای که از کاربر می گیره!
از کجا باید شروع کنم تاا یاد بگیرم توابع یا همچین چیزاییش رو!

hassan razavi
دوشنبه 28 آبان 1386, 12:08 عصر
http://barnamenevis.org/forum/showthread.php?t=83065

amindiary
دوشنبه 28 آبان 1386, 22:58 عصر
اون کامپوننتی که تو پست شما صحبتش بود رو لطفا برای من هم ارسال کنید:
amindiary@gmail.com
ممنونم:قلب:

hassan razavi
دوشنبه 28 آبان 1386, 23:17 عصر
براتون فرستادم. اگه نظری درباره این کامپوننت دارید در پست زیر مطرح کنید
http://barnamenevis.org/forum/showthread.php?t=83065

M.mojaddady@gmail.com
پنج شنبه 08 فروردین 1387, 03:41 صبح
لطفا" برای منم بفرستید
M.MOJADDADY@GMAIL.COM

h_kh_tehrani
پنج شنبه 08 فروردین 1387, 10:35 صبح
لطفاً برای من هم ارسال کنید ممنون میشمh_kh_tehrani@yahoo.com

Mahdi.Kiani
پنج شنبه 08 فروردین 1387, 23:56 عصر
دوستان محبت کنید، این جور موارد را با پیغام های خصوصی مطرح کنید..
خیلی از تاپیک های اینجا دارای تعداد زیادی پست است که فقط یک ایمیل دادین و در خواست کامپوننت کردین..
دوستانی هم که می خوان کامپوننتی را در اختیار دیگر دوستان بذارن می تونن اونو جایی آپلود کنند و لینکش را از طریق پیغام های خصوصی به کاربرانی که نیاز دارن بدن..
اینجوی هم مشکل برای سایت پیش نخواهد امد و هم اینکه اینگونه تاپیک هایی که جنبه علمی ندارن از تالار های مختلف حذف می شوند
به عنوان مثال در .... این تاپیک .... (http://barnamenevis.org/forum/showthread.php?t=83065&page=17) بیش از 160 تا پست بیخود زده شده...
موفق باشید

arshia_m
جمعه 09 فروردین 1387, 01:07 صبح
سلام
حق با شماست.من رسما عذر خواهی می کنم.
البته شما هم مطرح کردین.
http://barnamenevis.org/forum/showthread.php?t=88231&page=2

arshia_m
جمعه 09 فروردین 1387, 14:10 عصر
سلام

برای فرستادن فکس میشه از برنامه send a fax خود ویندوزنیز استفاده کرد

با اجرای فایل exe زیر:

fxssend.exe



string path = Environment.GetFolderPath(Environment.SpecialFolde r.System);

System.Diagnostics.Process.Start(path + "\\fxssend.exe");

armiya
یک شنبه 18 فروردین 1387, 20:26 عصر
کا مپو ننت رو به من هم بذین منون می شم

armiya
یک شنبه 18 فروردین 1387, 20:27 عصر
armiya_shab@yahoo.com

Reza1607
چهارشنبه 08 اردیبهشت 1389, 13:08 عصر
rz.zare@gmail.com

SaeedMK
چهارشنبه 30 شهریور 1390, 21:07 عصر
سلام با عرض معذرت اگه میشه این کامپوننت و برای من هم بفرستید خیلی خیلی ممنون میشم
Saeed_7394@yahoo.com:خجالت::چشمک:

hadisadaghatmehr
پنج شنبه 31 شهریور 1390, 12:21 عصر
با سلام خدمت دوستان
من از كامپوننت خود ويندوز استفاده مي كنم ولي فقط فايلهاي پي دي اف رو مي تونم ارسال كنم و فايلهاي ديگه مثلا ورد يا تكست رو نمي تونم ارسال كنم.آيا دستورات خاصي براي اين كار وجود داره؟؟
من از FaxcomLibe خود ويندوز استفاده مي كنم
لطفا راهنمايي بفرماييد

manager
سه شنبه 22 آذر 1390, 17:17 عصر
3000 تا پست بیخودی زدین یکی همت می کرد برنامه کامل ارسال و دریافتش رو میذاشت، هر 10 تا پست بیخود مدیر هم یه پست بیخود دیگه زده تذکر داده خود همین پست هم یه پست بی خوده مدیریت محترم اگر بهتون بر نمی خوره به جای تذکر برو پست های اضافه رو پاک کن خودتم پست نزن تاپیک رو تر و تمیز کن یکی می یاد دنبال یه چیزی زود پیدا کنه.

hadi_peek
شنبه 03 دی 1390, 08:57 صبح
لطفا به این ایمیل هم بفرستید hadi_peek@yahoo.com

javadasadi
یک شنبه 25 دی 1390, 12:55 عصر
سلام دوست عزیز من میخوام از یه برنامه کاربردی از طریق مودم سیستم فاکسو دریافت کنم اگه ممکنه راهنمایم کنید "javad.asadi@yahoo.com"

esi_0o0
چهارشنبه 17 خرداد 1391, 17:05 عصر
اگه ممکنه یه نمونه برنامه کوچیک از موضوع تاپیک در اختیار باشه ممنون میشم اگه نه لا اقل کامپوننت رو به منم ارسال کنین e_azariyoon@yahoo.com
ممنون میشم

mahdad sepah
سه شنبه 28 شهریور 1391, 16:46 عصر
کسی یک برنامه نداره که یه ارسال و دریافت ساده داشته باشه تا همه راحت بشن؟

mahdi.afzali
شنبه 23 شهریور 1392, 13:55 عصر
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FAXCONTROLLib;
using Microsoft.Office.Core;
using System.Diagnostics;
using System.IO;
namespace ITD_FS
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
public FaxControlClass fsCheck = new FaxControlClass();
private XPExplorerBar.Expando expando2;
private XPExplorerBar.Expando expando3;
private XPExplorerBar.TaskPane taskPane1;
private XPExplorerBar.Expando expando1;
private XPExplorerBar.TaskItem taskItem1;
private XPExplorerBar.Expando expando4;
private XPExplorerBar.TaskItem taskItem2;
private XPExplorerBar.TaskItem taskItem3;
private XPExplorerBar.TaskItem taskItem4;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.Button btnContact;
private System.Windows.Forms.Button btnFax;
private System.Windows.Forms.Button btnAbout;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.PrintDialog printDialog1;
// the way to handle parameters you don't care about in .NET
public object missing = System.Reflection.Missing.Value;
public object myTrue = true; // Print in background
public object myFalse = false;
public frmMain()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
this.expando2 = new XPExplorerBar.Expando();
this.taskItem1 = new XPExplorerBar.TaskItem();
this.expando3 = new XPExplorerBar.Expando();
this.taskPane1 = new XPExplorerBar.TaskPane();
this.expando1 = new XPExplorerBar.Expando();
this.taskItem2 = new XPExplorerBar.TaskItem();
this.taskItem3 = new XPExplorerBar.TaskItem();
this.taskItem4 = new XPExplorerBar.TaskItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.expando4 = new XPExplorerBar.Expando();
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnSearch = new System.Windows.Forms.Button();
this.btnContact = new System.Windows.Forms.Button();
this.btnFax = new System.Windows.Forms.Button();
this.btnAbout = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.printDialog1 = new System.Windows.Forms.PrintDialog();
((System.ComponentModel.ISupportInitialize)(this.e xpando2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.e xpando3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.t askPane1)).BeginInit();
this.taskPane1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.e xpando1)).BeginInit();
this.expando1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.e xpando4)).BeginInit();
this.expando4.SuspendLayout();
this.SuspendLayout();
//
// expando2
//
this.expando2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.expando2.Animate = true;
this.expando2.CustomSettings.WatermarkAlignment = System.Drawing.ContentAlignment.MiddleRight;
this.expando2.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando2.Location = new System.Drawing.Point(12, 12);
this.expando2.Name = "expando2";
this.expando2.TabIndex = 0;
this.expando2.TitleImage = ((System.Drawing.Image)(resources.GetObject("expando2.TitleImage")));
//
// taskItem1
//
this.taskItem1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem1.BackColor = System.Drawing.Color.Transparent;
this.taskItem1.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.taskItem1.Image = null;
this.taskItem1.Location = new System.Drawing.Point(16, 40);
this.taskItem1.Name = "taskItem1";
this.taskItem1.Size = new System.Drawing.Size(152, 16);
this.taskItem1.TabIndex = 0;
this.taskItem1.Text = "taskItem1";
this.taskItem1.Click += new System.EventHandler(this.taskItem1_Click_1);
//
// expando3
//
this.expando3.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando3.Location = new System.Drawing.Point(336, 296);
this.expando3.Name = "expando3";
this.expando3.TabIndex = 1;
this.expando3.Text = "expando3";
//
// taskPane1
//
this.taskPane1.AutoScrollMargin = new System.Drawing.Size(12, 12);
this.taskPane1.Dock = System.Windows.Forms.DockStyle.Fill;
this.taskPane1.Expandos.AddRange(new XPExplorerBar.Expando[] {
this.expando1,
this.expando4});
this.taskPane1.Location = new System.Drawing.Point(0, 0);
this.taskPane1.Name = "taskPane1";
this.taskPane1.Size = new System.Drawing.Size(656, 462);
this.taskPane1.TabIndex = 1;
this.taskPane1.Text = "taskPane1";
this.taskPane1.Click += new System.EventHandler(this.taskPane1_Click);
//
// expando1
//
this.expando1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.expando1.Animate = true;
this.expando1.CustomSettings.WatermarkAlignment = System.Drawing.ContentAlignment.MiddleRight;
this.expando1.ExpandedHeight = 120;
this.expando1.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando1.Items.AddRange(new System.Windows.Forms.Control[] {
this.taskItem1,
this.taskItem2,
this.taskItem3,
this.taskItem4,
this.pictureBox1});
this.expando1.Location = new System.Drawing.Point(12, 12);
this.expando1.Name = "expando1";
this.expando1.Size = new System.Drawing.Size(632, 120);
this.expando1.TabIndex = 0;
this.expando1.Text = "Information";
this.expando1.TitleImage = ((System.Drawing.Image)(resources.GetObject("expando1.TitleImage")));
this.expando1.StateChanged += new XPExplorerBar.ExpandoEventHandler(this.expando1_St ateChanged);
//
// taskItem2
//
this.taskItem2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem2.BackColor = System.Drawing.Color.Transparent;
this.taskItem2.CustomSettings.FontDecoration = System.Drawing.FontStyle.Regular;
this.taskItem2.Image = null;
this.taskItem2.Location = new System.Drawing.Point(456, 64);
this.taskItem2.Name = "taskItem2";
this.taskItem2.Size = new System.Drawing.Size(112, 16);
this.taskItem2.TabIndex = 1;
this.taskItem2.Text = "taskItem2";
//
// taskItem3
//
this.taskItem3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem3.BackColor = System.Drawing.Color.Transparent;
this.taskItem3.CustomSettings.FontDecoration = System.Drawing.FontStyle.Regular;
this.taskItem3.Image = null;
this.taskItem3.Location = new System.Drawing.Point(456, 40);
this.taskItem3.Name = "taskItem3";
this.taskItem3.TabIndex = 2;
this.taskItem3.Text = "taskItem3";
//
// taskItem4
//
this.taskItem4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.taskItem4.BackColor = System.Drawing.Color.Transparent;
this.taskItem4.CustomSettings.FontDecoration = System.Drawing.FontStyle.Regular;
this.taskItem4.Image = null;
this.taskItem4.Location = new System.Drawing.Point(456, 88);
this.taskItem4.Name = "taskItem4";
this.taskItem4.Size = new System.Drawing.Size(112, 16);
this.taskItem4.TabIndex = 3;
this.taskItem4.Text = "Clock";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(576, 56);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(48, 48);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchIma ge;
this.pictureBox1.TabIndex = 4;
this.pictureBox1.TabStop = false;
//
// expando4
//
this.expando4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.expando4.Animate = true;
this.expando4.ExpandedHeight = 300;
this.expando4.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.expando4.Items.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.btnSearch,
this.btnContact,
this.btnFax,
this.btnAbout,
this.label1,
this.label2,
this.label3,
this.label4,
this.label5,
this.label6,
this.label7,
this.label8});
this.expando4.Location = new System.Drawing.Point(12, 144);
this.expando4.Name = "expando4";
this.expando4.Size = new System.Drawing.Size(632, 300);
this.expando4.TabIndex = 1;
this.expando4.Text = "FAX Document";
this.expando4.TitleImage = ((System.Drawing.Image)(resources.GetObject("expando4.TitleImage")));
this.expando4.StateChanged += new XPExplorerBar.ExpandoEventHandler(this.expando4_St ateChanged);
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox1.ForeColor = System.Drawing.SystemColors.WindowText;
this.textBox1.Location = new System.Drawing.Point(16, 64);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(504, 21);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
//
// btnSearch
//
this.btnSearch.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Image = ((System.Drawing.Image)(resources.GetObject("btnSearch.Image")));
this.btnSearch.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnSearch.Location = new System.Drawing.Point(528, 64);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(96, 21);
this.btnSearch.TabIndex = 1;
this.btnSearch.Text = "Browse";
this.btnSearch.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
//
// btnContact
//
this.btnContact.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnContact.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnContact.Image = ((System.Drawing.Image)(resources.GetObject("btnContact.Image")));
this.btnContact.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnContact.Location = new System.Drawing.Point(528, 176);
this.btnContact.Name = "btnContact";
this.btnContact.Size = new System.Drawing.Size(96, 40);
this.btnContact.TabIndex = 2;
this.btnContact.Text = "FAX Info";
this.btnContact.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnContact.Click += new System.EventHandler(this.btnContact_Click);
//
// btnFax
//
this.btnFax.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnFax.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFax.Image = ((System.Drawing.Image)(resources.GetObject("btnFax.Image")));
this.btnFax.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnFax.Location = new System.Drawing.Point(528, 112);
this.btnFax.Name = "btnFax";
this.btnFax.Size = new System.Drawing.Size(96, 40);
this.btnFax.TabIndex = 3;
this.btnFax.Text = "Send FAX";
this.btnFax.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnFax.Click += new System.EventHandler(this.btnFax_Click);
//
// btnAbout
//
this.btnAbout.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnAbout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAbout.Image = ((System.Drawing.Image)(resources.GetObject("btnAbout.Image")));
this.btnAbout.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnAbout.Location = new System.Drawing.Point(528, 240);
this.btnAbout.Name = "btnAbout";
this.btnAbout.Size = new System.Drawing.Size(96, 40);
this.btnAbout.TabIndex = 4;
this.btnAbout.Text = "About Us";
this.btnAbout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 128);
this.label1.Name = "label1";
this.label1.TabIndex = 5;
this.label1.Text = "Number of pages :";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 160);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(112, 23);
this.label2.TabIndex = 6;
this.label2.Text = "Number of sections :";
//
// label3
//
this.label3.Location = new System.Drawing.Point(16, 192);
this.label3.Name = "label3";
this.label3.TabIndex = 7;
this.label3.Text = "Spelling Errors :";
//
// label4
//
this.label4.Location = new System.Drawing.Point(16, 224);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(112, 23);
this.label4.TabIndex = 8;
this.label4.Text = "Grammatical Errors :";
//
// label5
//
this.label5.Location = new System.Drawing.Point(136, 128);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(312, 23);
this.label5.TabIndex = 9;
//
// label6
//
this.label6.Location = new System.Drawing.Point(136, 160);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(312, 23);
this.label6.TabIndex = 10;
//
// label7
//
this.label7.Location = new System.Drawing.Point(136, 192);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(312, 23);
this.label7.TabIndex = 11;
//
// label8
//
this.label8.Location = new System.Drawing.Point(136, 224);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(312, 23);
this.label8.TabIndex = 12;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// frmMain
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(656, 462);
this.Controls.Add(this.taskPane1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "frmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n;
this.Text = "ITD-FS :: IT Developers - Fax Service";
this.Closing += new System.ComponentModel.CancelEventHandler(this.frmM ain_Closing);
this.Load += new System.EventHandler(this.frmMain_Load);
((System.ComponentModel.ISupportInitialize)(this.e xpando2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.e xpando3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.t askPane1)).EndInit();
this.taskPane1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.e xpando1)).EndInit();
this.expando1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.e xpando4)).EndInit();
this.expando4.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmMain());
}
private void frmMain_Load(object sender, System.EventArgs e)
{
if (fsCheck.IsFaxServiceInstalled)
{
taskItem1.Text = "Fax service installed.";
taskItem1.Enabled = false;
}
else
{
taskItem1.Text = "Fax service not installed.";
btnContact.Enabled = false;
btnFax.Enabled = false;
}
DateConvertor myConvertor = new DateConvertor();
taskItem2.Text = DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString();
taskItem3.Text = myConvertor.ShamsiCompleteStringDate(DateTime.Now. Year,DateTime.Now.Month,DateTime.Now.Day);
}
private void taskItem1_Click(object sender, System.EventArgs e)
{
//fsCheck.InstallFaxService();
}
private void taskPane1_Click(object sender, System.EventArgs e)
{

}
private void expando4_StateChanged(object sender, XPExplorerBar.ExpandoEventArgs e)
{

}
private void expando1_StateChanged(object sender, XPExplorerBar.ExpandoEventArgs e)
{

}
private void timer1_Tick(object sender, System.EventArgs e)
{
taskItem4.Text = DateTime.Now.ToShortTimeString();
}
private void btnAbout_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process myProcess = new Process();
myProcess.StartInfo.RedirectStandardOutput=false;
myProcess.StartInfo.FileName=Application.StartupPa th.ToString() + "\\" + "ITDevelopers.exe";
myProcess.StartInfo.UseShellExecute=true;
myProcess.Start();
myProcess.Dispose();
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
Word.ApplicationClass WordApp = new Word.ApplicationClass();
OpenFileDialog myBrowser = new OpenFileDialog();
myBrowser.Filter = "Microsoft Word files (*.doc)|*.doc";
//myBrowser.ShowDialog();
if (myBrowser.ShowDialog() == DialogResult.OK)
{
textBox1.Text = myBrowser.FileName;


// give any file name of your choice.
object fileName = myBrowser.FileName;
object readOnly = true;
object isVisible = true;

// Make word visible, so you can see what's happening
//WordApp.Visible = true;
// Open the document that was chosen by the dialog

Word.Document aDoc = WordApp.Documents.Open(ref fileName,
ref missing, ref readOnly, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
// compute number of document page
Word.WdStatistic stat = Word.WdStatistic.wdStatisticPages;
int num = aDoc.ComputeStatistics(stat, ref missing);
//
// MessageBox.Show(num.ToString());
// MessageBox.Show(aDoc.GrammaticalErrors.Count.ToStr ing());
// MessageBox.Show(aDoc.Sections.Count.ToString());
// MessageBox.Show(aDoc.SpellingErrors.Count.ToString ());
label5.Text = num.ToString();
label6.Text = aDoc.Sections.Count.ToString();
label7.Text = aDoc.SpellingErrors.Count.ToString();
label8.Text = aDoc.GrammaticalErrors.Count.ToString();

//This two line clear WINWORD.EXE process from processes list
aDoc.Close(ref myFalse, ref missing, ref missing);

}
WordApp.Quit(ref myFalse, ref missing, ref missing);
}
private void btnContact_Click(object sender, System.EventArgs e)
{

System.Diagnostics.Process myProcess = new Process();
myProcess.StartInfo.RedirectStandardOutput=false;
myProcess.StartInfo.FileName=System.Environment.Sy stemDirectory.ToString()+"\\"+"fxsclnt.exe (file://\\)";
myProcess.StartInfo.UseShellExecute=true;
myProcess.Start();
myProcess.Dispose();

}
private void btnFax_Click(object sender, System.EventArgs e)
{
if (textBox1.Text.Length > 0)
{
Word.ApplicationClass WordApp = new Word.ApplicationClass();
System.Drawing.Printing.PrintDocument myDoc = new System.Drawing.Printing.PrintDocument();
PrintDialog pd = new PrintDialog();
pd.Document = myDoc;
//pd.ShowDialog();
if (pd.ShowDialog() == DialogResult.OK)
{
//////////////////////////////////////////////////////////////////////////////////

// give any file name of your choice.
object fileName =textBox1.Text;
object readOnly = true;
object isVisible = true;

// Make word visible, so you can see what's happening
//WordApp.Visible = true;
// Open the document that was chosen by the dialog

Word.Document aDoc = WordApp.Documents.Open(ref fileName,
ref missing, ref readOnly, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
// compute number of document page
Word.WdStatistic stat = Word.WdStatistic.wdStatisticPages;
int num = aDoc.ComputeStatistics(stat, ref missing);
///////////////////////////////////////////////////////////////////////////////////////
// Set the active printer
WordApp.ActivePrinter = pd.PrinterSettings.PrinterName;

// Using PrintOutOld to be version independant
WordApp.ActiveDocument.PrintOutOld(ref myTrue,
ref myFalse, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref myFalse, ref missing, ref missing, ref missing);

// Make sure all of the documents are gone from the queue
while (WordApp.BackgroundPrintingStatus > 0)
{
System.Threading.Thread.Sleep(250);
}

//This two line clear WINWORD.EXE process from processes list
aDoc.Close(ref myFalse, ref missing, ref missing);

}
WordApp.Quit(ref myFalse, ref missing, ref missing);
}
else
{
MessageBox.Show("You should choose a file to send.");
}
}
private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//WordApp.Quit(ref myFalse, ref missing, ref missing);
}
private void taskItem1_Click_1(object sender, System.EventArgs e)
{
fsCheck.InstallFaxService();
Application.Exit();
}
}
}



این کد یک فایل با پسوند doc را انتخاب و ارسال میکند.
سلام،وقتی چند تا مودم و چند تا خط تلفن داریم چگونه در ارسال فاکس با ویندوز مودم مورد نظر را انتخاب کنیم