public static string BuildCategoryUrl(RFS rfs) { string finalUrl = ""; List <string> urlMembers = new List <string>(); string tempUrl = rfs.ID.TrimEnd() + "-" + rfs.NOM.TrimEnd(); finalUrl = Utils.Utils.GetFriendlyUrl(tempUrl); return(finalUrl); }
static void Main(string[] args) { try { var rfs = new RFS(); rfs.Mount("r:\\", DokanOptions.DebugMode | DokanOptions.StderrOutput); Console.WriteLine(@"Success"); } catch (DokanException ex) { Console.WriteLine(@"Error: " + ex.Message); } }
/// <summary> /// Url format : {Rayon}-{Modele}-{Id} /// </summary> /// <param name="s"></param> /// <returns></returns> public static string BuildProductUrl(STOCK s, SqlConnection connection) { string finalUrl = ""; List <string> urlMembers = new List <string>(); string firstMember = RFS.GetRFSNameById(RFS.TYPE.RAYON, s.S_ID_RAYON, connection); if (!String.IsNullOrWhiteSpace(firstMember)) { urlMembers.Add(firstMember); } string secondMember = s.S_MODELE.TrimEnd(); if (!String.IsNullOrWhiteSpace(secondMember)) { urlMembers.Add(secondMember); } string thirdMember = s.S_ID.TrimEnd(); urlMembers.Add(thirdMember); foreach (string u in urlMembers) { if (u == urlMembers.First()) { finalUrl = u; } else if (!String.IsNullOrWhiteSpace(u)) { finalUrl += " " + u; } } finalUrl = Utils.Utils.GetFriendlyUrl(finalUrl); return(finalUrl); }