コード例 #1
0
        public TestOutcome CreateFile(string path)
        {
            TestOutcome outcome = new TestOutcome();

            outcome.moduleName = "Folders";
            outcome.methodName = "FolderFile";
            string imageName = "World-" + System.DateTime.Now.ToString("G", CultureInfo.CreateSpecificCulture("en-US")).Replace('/', '-').Replace(':', '_');

            try
            {
                FoldersApi foldersApi = new FoldersApi(_url);
                //string systempath = Environment.CurrentDirectory;
                string systempath = Application.StartupPath;
                using (FileStream fs = new FileStream(systempath + "\\world.jpg", FileMode.Open))
                {
                    foldersApi.FolderFile(_session.SessionId, path, fs, imageName);
                }
                outcome.outcome = "Success";
                return(outcome);
            }
            catch (Exception ex)
            {
                outcome.outcome = ex.Message;
                return(outcome);
            }
        }