多线程或线程池下的相对路径转绝对路径

                if (HttpContext.Current != null)
                {                       
                  localpath = HttpContext.Current.Server.MapPath(directorypath);                  
                }
                else
                {
                    directorypath = directorypath.Replace("/", "\");                              
                    localpath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, directorypath);
                }

  

原文地址:https://www.cnblogs.com/ares-yang/p/8808969.html