Beispiel #1
0
        /// <summary>Page Load.</summary>
        public void Page_Load
        (
            object sender,
            EventArgs e
        )
        {
            string exceptionMessage = null;

            ServerMapPath            = this.MapPath("");
            FilenameConfigurationXml = Path.Combine(ServerMapPath, FilenameConfigurationXml);
            UtilityImpersonate.GetUsernamePasswordDomainName
            (
                ref FilenameConfigurationXml,
                ref ImpersonateDomainName,
                ref ImpersonatePassword,
                ref ImpersonateUserName,
                ref exceptionMessage
            );
            if (exceptionMessage != null)
            {
                Feedback = exceptionMessage; return;
            }
            if (!Page.IsPostBack)
            {
                TextBoxText.Focus();
                Page.SetFocus(TextBoxText);
            } //if ( !Page.IsPostBack )
        }     //Page_Load
  ///<summary>MailReceive.</summary>
  public static void MailReceive()
  {
   int       port              =  PortPOP3;

   String    domainName        =  null;
   String    exceptionMessage  =  null;
   String    password          =  null;
   String    serverNamePOP3    =  ServerNamePOP3;
   String    username          =  null;

   UtilityImpersonate.GetUsernamePasswordDomainName
   (
    ref  FilenameConfigurationXml,
    ref  username,
    ref  domainName,
    ref  password,
    ref  exceptionMessage
   );

   MailReceive
   (
    ref serverNamePOP3,
    ref port,
    ref username,
    ref password,
    ref exceptionMessage
   );

  }//public static void MailReceive()
Beispiel #3
0
        }//public void ButtonSubmit_Click()

        /// <summary>SpVoiceSpeak</summary>
        public void SpVoiceSpeak()
        {
            bool   impersonateValidUser = false;
            string exceptionMessage     = null;
            WindowsImpersonationContext windowsImpersonationContext = null;
            UtilitySpeechArgument       utilitySpeechArgument       = null;

            utilitySpeechArgument = new UtilitySpeechArgument
                                    (
                CheckBoxXml.Checked,
                new string[] { FileUploadSource.PostedFile.FileName },
                FileUploadAudio.PostedFile.FileName,
                new string[] { TextBoxText.Text },
                null //voice
                                    );
            try
            {
                impersonateValidUser = UtilityImpersonate.ImpersonateValidUser
                                       (
                    ref ImpersonateDomainName,
                    ref ImpersonatePassword,
                    ref ImpersonateUserName,
                    ref windowsImpersonationContext,
                    ref exceptionMessage
                                       );
                if (exceptionMessage != null)
                {
                    Feedback = exceptionMessage; return;
                }
                if (impersonateValidUser == false)
                {
                    return;
                }
                UtilitySpeech.SpVoiceSpeak
                (
                    ref utilitySpeechArgument,
                    ref exceptionMessage
                );
                UtilityImpersonate.UndoImpersonation
                (
                    ref windowsImpersonationContext,
                    ref exceptionMessage
                );
            }//try
            catch (Exception exception) { exceptionMessage = exception.Message; }
            if (exceptionMessage != null)
            {
                Feedback = exceptionMessage;
            }
        } //public static void SpVoiceSpeak()
  }//Page_Load

  ///<summary>Page Unload.</summary>
  public void Page_Unload
  (
   object     sender, 
   EventArgs  e
  ) 
  {
   String  exceptionMessage = null;

   UtilityImpersonate.UndoImpersonation
   (
    ref windowsImpersonationContext,
    ref exceptionMessage
   );

   if ( exceptionMessage != null )
   {
    Feedback = exceptionMessage;
    return;
   }//if ( exceptionMessage != null )

  }//public void Page_Unload()
  /// <summary>Page Load.</summary>
  public void Page_Load
  (
   object     sender, 
   EventArgs  e
  ) 
  {

   Boolean                      statusImpersonateValidUser     =  false;
   Boolean                      statusRevertToSelf             =  false;

   int                          statusLogonUserA               =  -1;
   int                          statusDuplicateToken           =  -1;

   IntPtr                       token                          =  IntPtr.Zero;
   IntPtr                       tokenDuplicate                 =  IntPtr.Zero;

   String                       domainName                     =  null;
   String                       exceptionMessage               =  null;
   String                       password                       =  null;
   String                       userName                       =  null;
   
   ServerMapPath = this.MapPath("");
   if ( ServerMapPath != null)
   {
    FilenameConfigurationXml = ServerMapPath + @"\" + FilenameConfigurationXml;
   }//if ( ServerMapPath != null)

   UtilityXml.XmlDocumentNodeInnerText
   (
        FilenameConfigurationXml,
    ref exceptionMessage,         
        UtilitySubnetMask.XPathDatabaseConnectionString,
    ref DatabaseConnectionString
   );

   if ( exceptionMessage != null )
   {
    Feedback = exceptionMessage;
    return;
   }//if ( exceptionMessage != null )

   UtilityImpersonate.Impersonate
   (
    ref FilenameConfigurationXml,
    ref userName,
    ref domainName,
    ref password,
    ref windowsImpersonationContext,
    ref exceptionMessage,
    ref statusImpersonateValidUser,
    ref statusRevertToSelf,
    ref statusLogonUserA,
    ref statusDuplicateToken,
    ref token,
    ref tokenDuplicate
   );

   if ( exceptionMessage != null )
   {
     Feedback = exceptionMessage;
     return;
   }//if ( exceptionMessage != null )

  }//Page_Load
  }//public static void ConfigurationXml()

  /// <summary>ConfigurationXml.</summary>
  public static void ConfigurationXml
  (
   ref String         filenameConfigurationXml,
   ref String         exceptionMessage,
   ref String         connectionStringDatabase,
   ref String         databaseName,
   ref String         directoryDatafile,
   ref String         tableName,
   ref String         userName,
   ref String         domainName,
   ref String         password
  )
  {

   UtilityXml.XmlDocumentNodeInnerText
   (
         filenameConfigurationXml,
     ref exceptionMessage,         
         XPathConnectionStringDatabase,
     ref connectionStringDatabase
   );

   UtilityXml.XmlDocumentNodeInnerText
   (
         filenameConfigurationXml,
     ref exceptionMessage,         
         XPathBCPDatabase,
     ref databaseName
   );

   UtilityXml.XmlDocumentNodeInnerText
   (
         filenameConfigurationXml,
     ref exceptionMessage,         
         XPathBCPDirectoryDataFile,
     ref directoryDatafile
   );

   UtilityXml.XmlDocumentNodeInnerText
   (
         filenameConfigurationXml,
     ref exceptionMessage,         
         XPathBCPTable,
     ref tableName
   );

   UtilityImpersonate.GetUsernamePasswordDomainName
   (
    ref filenameConfigurationXml,
    ref userName,
    ref domainName,
    ref password,
    ref exceptionMessage
   );

   UtilityDebug.Write
   (
    String.Format
    (
     "filenameConfigurationXml: {0} | connectionStringDatabase: {1} | databaseName: {2} | directoryDatafile: {3} | tableName: {4}", 
     filenameConfigurationXml,
     connectionStringDatabase,
     databaseName,
     directoryDatafile,
     tableName
    )
   );
      
  }//public static void ConfigurationXml()