Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the last part of URL
Message
 
 
À
13/04/2018 03:51:40
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01659359
Message ID:
01659383
Vues:
25
>Since you don't give an example uri and since there can be an unknown number of segments and you also don't explain which bit you want then it's not possible to answer this.
>But .Segments is an array of strings and if, for example, you wanted the next to last then :
Request.Url.Segments[Request.Url.Segments.Length-2]
Thanks, Viv. I wanted the very last segment and I just solved it using Path.GetFileName instead.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform