private static FaxDeviceProvider GetExistingFaxProvider(FaxServer faxServer) { FaxDeviceProvider existing = null; faxServer.GetDeviceProviders().Cast <FaxDeviceProvider>().ToList().ForEach(provider => { Console.WriteLine("Existing fax provider {0} {1} {2} {3}", provider.UniqueName, provider.FriendlyName, provider.ImageName, string.Format("{0}.{1}.{2}.{3}", provider.MajorVersion, provider.MajorBuild, provider.MinorVersion, provider.MinorBuild)); if (provider.UniqueName == FSPConfig.ProviderGuid) { existing = provider; } }); Console.WriteLine("{0} matching fax provider {1} {2} {3} {4}", existing != null ? "Found" : "No", FSPConfig.ProviderGuid, existing != null ? existing.FriendlyName : FSPConfig.ProviderName, existing != null ? existing.ImageName : FSPConfig.ProviderPath, existing != null ? string.Format("{0}.{1}.{2}.{3}", existing.MajorVersion, existing.MajorBuild, existing.MinorVersion, existing.MinorBuild) : FSPConfig.ProviderVersion); return(existing); }
public void SendFax() { try { FaxDocumentSetup("Tuan", "THCOMPANY", txt_file.Text, "Send Test Fax from Windows", "Test file", txt_faxnum.Text); object submitReturnValue = faxDoc.Submit(faxServer.ServerName); faxDoc = null; rtd_log.Text += "Activity: " + faxServer.Activity + Environment.NewLine + "Configuration: " + faxServer.Configuration + Environment.NewLine + "CurrentAccount: " + faxServer.CurrentAccount + Environment.NewLine + "FaxAccountSet: " + faxServer.FaxAccountSet + Environment.NewLine + "GetDeviceProviders: " + faxServer.GetDeviceProviders().Count + Environment.NewLine + "GetDevices: " + faxServer.GetDevices().Count + Environment.NewLine + "LoggingOptions.ActivityLogging: " + faxServer.LoggingOptions.ActivityLogging + Environment.NewLine + "LoggingOptions.ActivityLogging: " + faxServer.ServerName + Environment.NewLine + faxServer.Activity.IncomingMessages.ToString() + " \n" + faxServer.Activity.OutgoingMessages.ToString() + " \n" + faxServer.Activity.QueuedMessages.ToString() + " \n" + faxServer.Activity.RoutingMessages.ToString(); } catch (Exception comException) { MessageBox.Show("Data: " + comException.Data + "\n" + "HelpLink: " + comException.HelpLink + "\n" + "HResult: " + comException.HResult + "\n" + "InnerException: " + comException.InnerException + "\n" + "Message: " + comException.Message + "\n" + "Source: " + comException.Source + "\n" + "StackTrace: " + comException.StackTrace + "\n" + "TargetSite: " + comException.TargetSite); } }