Re: image, category and default album config files

  •  03-31-2011, 1:04 AM

    Re: image, category and default album config files

    Hi globosoft,
     
    1. How can I access, read, write display the "properties" attributes found in the config files shown below?
     
    The example below shows you how the get the properties of photo
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>  
    4.   
    5. <script runat="server">  
    6.     void Page_Load(object sender, EventArgs e)  
    7.     {  
    8.         gallery1.AllowEdit = true;  
    9.         gallery1.AllowPostComment = true;  
    10.         gallery1.AllowShowComment = true;  
    11.   
    12.         using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))  
    13.         {  
    14.             //get all categories  
    15.   
    16.             string[] categoryArray = provider.GetCategoryArray();  
    17.             for (int i = 0; i < categoryArray.Length; i++)  
    18.             {  
    19.                 //get all photos  
    20.                 string[] photoArray = provider.GetPhotoArray(categoryArray[i]);  
    21.                 string categoryID = categoryArray[i];  
    22.                 string photoID;  
    23.                 for (int j = 0; j < photoArray.Length; j++)  
    24.                 {  
    25.                     photoID = provider.GetPhotoArray(categoryArray[i])[j];  
    26.                     string title;  
    27.                     string comment;  
    28.                     int width;  
    29.                     int height;  
    30.                     int fileSize;  
    31.                     string ipaddress;  
    32.                     string propexpr;  
    33.                     DateTime time;  
    34.                     provider.GetPhotoInfo(categoryID, photoID, out title, out comment, out width, out height, out fileSize, out ipaddress, out propexpr, out time);  
    35.                     label1.Text += (title + "-" + comment + width.ToString() + "-" + height.ToString() + "-" + fileSize.ToString() + "-" + ipaddress + "-" + propexpr + "-" + time.ToString() + "<br/>");  
    36.   
    37.                 }  
    38.   
    39.             }  
    40.         }  
    41.     }  
    42.    
    43. </script>  
    44.   
    45. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  
    46. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
    47. <head runat="server">  
    48.     <title></title>  
    49. </head>  
    50. <body>  
    51.     <form id="form1" runat="server">  
    52.         <asp:Label ID="label1" runat="server"></asp:Label>  
    53.         <a href="#" onclick="thegallerybrowser.ShowEditor();return false;">Admin Console</a>  
    54.         <DotNetGallery:GalleryBrowser runat="server" ID="gallery1" Width="720" Height="430" />  
    55.     </form>  
    56. </body>  
    57. </html> 
     2. Also, what about userid attribute, can that be accessed?
     
    Can you show me which property you mean? (there is not a userid property in the config file)
     
    3. And how would a developer set username attribute to something other then (Guest)?
     
    Please explain this requirement on detail too.
     
    4. Lastly, I notice that many of the responses show examples where C# is used to access the DotNetGallery. Are there any examples and is it possibly to access the DotNetGallery via VB.NET?
     
    Below is a vb.net example to shows you how to access the property of gallery
    1. <%@ Page Language="VB" %>  
    2.   
    3. <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <script runat="server">  
    7.   
    8.     Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs)  
    9.         gallery1.AllowEdit = True  
    10.         gallery1.AllowPostComment = True  
    11.         gallery1.AllowShowComment = True  
    12.     End Sub  
    13. </script>  
    14.   
    15. <html xmlns="http://www.w3.org/1999/xhtml">  
    16. <head runat="server">  
    17.     <title>Untitled Page</title>  
    18. </head>  
    19. <body>  
    20.     <form id="form1" runat="server">  
    21.         <div>  
    22.             <DotNetGallery:GalleryBrowser runat="server" ID="gallery1" Width="720" Height="430" />  
    23.         </div>  
    24.     </form>  
    25. </body>  
    26. </html> 
    Regards,
     
    Ken
View Complete Thread