ApiExamples.ExMossDoc2Pdf.Main C# (CSharp) Метод

Main() приватный Метод

private Main ( string args ) : void
args string
Результат void
        public static void Main(string[] args)
        {
            // Although SharePoint passes "-log <filename>" to us and we are
            // supposed to log there, for the sake of simplicity, we will use 
            // our own hard coded path to the log file.
            // 
            // Make sure there are permissions to write into this folder.
            // The document converter will be called under the document 
            // conversion account (not sure what name), so for testing purposes 
            // I would give the Users group write permissions into this folder.
            gLog = new StreamWriter(@"C:\Aspose2Pdf\log.txt", true);

            try
            {
                gLog.WriteLine(DateTime.Now.ToString() + " Started");
                gLog.WriteLine(Environment.CommandLine);

                ParseCommandLine(args);

                // Uncomment the code below when you have purchased a licenses for Aspose.Words.
                //
                // You need to deploy the license in the same folder as your 
                // executable, alternatively you can add the license file as an 
                // embedded resource to your project.
                //
                // // Set license for Aspose.Words.
                // Aspose.Words.License wordsLicense = new Aspose.Words.License();
                // wordsLicense.SetLicense("Aspose.Total.lic");

                ConvertDoc2Pdf(gInFileName, gOutFileName);
            }
            catch (Exception e)
            {
                gLog.WriteLine(e.Message);
                Environment.ExitCode = 100;
            }
            finally
            {
                gLog.Close();
            }
        }