| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 567 人关注过本帖
标题:请问以下程序中catch中的return有什么用
取消只看楼主 加入收藏
恶魔城主
Rank: 1
等 级:新手上路
帖 子:8
专家分:7
注 册:2012-3-11
结帖率:75%
收藏
已结贴  问题点数:20 回复次数:0 
请问以下程序中catch中的return有什么用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using

namespace 文件使用
{
    class Program
    {
        public static void Main()
        {
            string[] CLA = Environment.GetCommandLineArgs();
            Console.WriteLine(CLA[0]);
              if (CLA.Length < 3)
             {
               Console.WriteLine("Format:{0} orig-file new-file",CLA[0]);

            }
            else {
          string origfile;
            origfile = CLA[1];
            string newfile;
            newfile = CLA[2];
   try
              {
                  File.Copy(origfile, newfile );
              }
              catch () { Console.WriteLine("{0}dose not exist", origfile);
              return;
              }
              catch (Exception e) { Console.WriteLine("An exception was thrown trying to copy file.");
              return;
              }


          Console.WriteLine("Copy...");

            }

           
       Console.WriteLine(".....Done");
        }
    }
}
搜索更多相关主题的帖子: void return public 
2012-07-24 18:27
快速回复:请问以下程序中catch中的return有什么用
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014979 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved