If you want to read the Content of a Media Folder (ex. for an Picture Gallery) from a .net User Control there is a short snippet to implement:
1: using System;
2: using System.Collections.Generic;
3: using System.Web;
4: using System.Web.UI;
5: using System.Web.UI.WebControls;
6: using umbraco.presentation.nodeFactory;
7: using umbraco.cms.businesslogic.media;
8:
9:
10: protected override void Render(HtmlTextWriter writer)
11: {
12: try
13: {
14: if (Folder != string.Empty)
15: {
16: int i = int.Parse(Folder);
17: umbraco.cms.businesslogic.media.Media m = new umbraco.cms.businesslogic._ media.Media(i);
18: List<string> ContentToRender = new List<string>();
19:
20: string s = "";
21: foreach (Media item in m.Children)
22: {
23: try
24: {
25: string Path = item.getProperty("umbracoFile").Value.ToString();
26: }
27: }
28: catch (Exception)
29: {
30: }
31: }
32: }
33: else
34: {
35: writer.Write("Error: Parameter Folder = Empty");
36: }
37: }
38: catch (Exception ex)
39: {
40: writer.Write(ex.Message);
41: }
42: }
43: }