>> string filepath = @"\folder\aaa.bb"; >> //string filepath = @"\aaa.bb"; // fails >> >> string pat = @"\\(?:.+)\\(.+)\.(.+)"; >> >> >> >> >> var m = Regex.Match(filepath, pat); >> >> if (m.Success) >> { >> Console.WriteLine("{0}", m.Groups[1].Captures[0].ToString()); >> Console.WriteLine("{0}", m.Groups[2].Captures[0].ToString()); >> } >> else >> Console.WriteLine("No match"); >> >> >> Console.ReadLine();>
string fullFileName = @"~/Images/" + this.uplLogo.FileName; this.uplLogo.SaveAs(Server.MapPath(fullFileName));This seems to work