コード例 #1
0
    static void Main(string[] args)
    {
        Options options = new Options();

        if (!options.Parse(args))
        {
            Environment.Exit(1);
        }

        RetsSession session = options.SessionFactory();

        session.SetIncrementalMetadata(options.full_metadata ? false : true);

        try
        {
            if (!session.Login(options.user_name, options.user_password))
            {
                Console.WriteLine("Invalid login");
                Environment.Exit(1);
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("RetsException: " + e);
            Environment.Exit(1);
        }

        RetsMetadata metadata = session.GetMetadata();

        dumpSystem(metadata);
        dumpForeignKeys(metadata);
        dumpAllResources(metadata);

        session.Logout();
    }