Thanks.
CS
"JJ" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> This is what I use to get an array of the name of all themes:
>
>
>
> public static string[] GetThemes()
>
> {
>
> if (HttpContext.Current.Cache["SiteThemes"] != null)
>
> {
>
> return (string[])HttpContext.Current.Cache["SiteThemes"];
>
> }
>
> else
>
> {
>
> string themesDirPath = HttpContext.Current.Server.MapPath("~/App_Themes");
>
> string[] themes = Directory.GetDirectories(themesDirPath);
>
> for (int i = 0; i <= themes.Length - 1; i++)
>
> themes[i] = Path.GetFileName(themes[i]);
>
> // cache the array
>
> CacheDependency dep = new CacheDependency(themesDirPath);
>
> HttpContext.Current.Cache.Insert("SiteThemes", themes, dep);
>
> return themes;
>
> }
>
> }
>
>
>
> JJ
>
> "WT" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello,
>>
>> I need to list all available themes for a .NET app, is there any API in
>> .NET2 for this or should I explore the folder files using IO methods ?
>>
>> Thanks for indication
>> CS
>>
>
>