none
image library에서 폴더 이름 바꾸기 RRS feed

  • 질문

  • Image library 에서 폴더를 생성하고 이미지를 저장했는데,

    폴더 이름을 바꾸려고 합니다. 가능한가요? 가능하다면 방법은?

    2006년 8월 10일 목요일 오전 8:24

모든 응답

  • 물론 가능합니다

    변경하고자하는 폴더의 드롭다운 리스트를 선택하여 등록정보 편집이라는 메뉴가 있습니다.

    이를 누르면 폴더 이름을 변경할 수 있는 페이지로 이동합니다.

     

    도움이 되셨으면 합니다.

     

    2006년 8월 10일 목요일 오전 8:30
  • 아래 클래스를 사용하시면 progrmmable하게 folder 이름을 제어하실 수 있습니다. ^^

    이름은 string 형식인 SPFolder.Name 속성을 사용하시면 됩니다. ^^

    SPFolder Class

    The SPFolder class represents a folder on a SharePoint Web site.

    System.Object

       Microsoft.SharePoint.SPFolder

    [Visual Basic]

    Public Class SPFolder 
       Inherits System.Object

    [C#]

    public class SPFolder : System.Object

    Public Methods

    The following table shows the public methods of the SPFolder class and a brief description of each.

    Name Description
    CopyTo Copies the folder and its contents into a new folder at the specified URL.
    MoveTo Moves the folder to the specified URL.
    ToString Returns the relative URL of the folder based on the parent Web site.

    Public Properties

    The following table shows the public properties of the SPFolder class, the data type of each property, and a brief description of each.

    Name Data Type Description
    ContainingDocumentLibrary System.Guid Gets the document library that contains the folder.
    Exists Boolean Gets a Boolean value that indicates whether the folder exists.
    Files Microsoft.SharePoint.SPFileCollection Gets the collection of all files contained in the folder.
    Name String Gets the name of the folder.
    ParentFolder Microsoft.SharePoint.SPFolder Gets the parent folder of the folder.
    ParentWeb Microsoft.SharePoint.SPWeb Gets the parent Web site of the folder.
    ServerRelativeUrl String Gets the server-relative URL of the folder.
    SubFolders Microsoft.SharePoint.SPFolderCollection Gets the collection of subfolders contained within the folder.
    Url String Gets the site-relative URL of the folder.

    Thread Safety

    Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

    Remarks

    Various folder properties exist in the Microsoft.SharePoint namespace that return a folder object, but the GetFolder method of the SPWeb class returns any folder from within a site or subsite.

    Use the Folders property of the SPWeb class, or the Subfolders property of the SPFolder class, to return an SPFolderCollection object that represents the collection of folders for a site or folder. Use an indexer to return a single folder from the collection. For example, if the collection is assigned to a variable named myFolders, use myFolders[index] in C#, or myFolders(index) in Visual Basic .NET, where index is either the index number of the folder in the collection or the display name of the folder.

    Example

    The following code example displays information about the folders in a site and all its subsites, including the site name, folder name, number of files in the folder, and total size of the files.

    [Visual Basic .NET]

    Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
    Dim sites As SPWebCollection = siteCollection.AllWebs
    Dim site As SPWeb
    
    For Each site In  sites
    
        Dim folders As SPFolderCollection = site.Folders
        Dim folder As SPFolder
    
        For Each folder In  folders
    
            Dim files As SPFileCollection = folder.Files
            Dim totalFileSize As Long = 0
            Dim i As Integer
    
            For i = 0 To files.Count - 1
                totalFileSize += files(i).Length
            Next i
    
            Label1.Text += " Web: " & SPEncode.HtmlEncode(site.Name) & " Folder: " _
                & SPEncode.HtmlEncode(folder.Name) & " Number: " & folder.Files.Count _
                & " Size: " & totalFileSize & "<BR>"
    
        Next folder
    
    Next site

    [C#]

    SPSite siteCollection = SPControl.GetContextSite(Context);
    SPWebCollection sites = siteCollection.AllWebs;
    
    foreach (SPWeb site in sites)
    {
        SPFolderCollection folders = site.Folders;
    
        foreach (SPFolder folder in folders)
        {
            SPFileCollection files = folder.Files;
    
            long totalFileSize = 0;
    
            for (int i=0; i<files.Count; i++)        {
                totalFileSize += filesIdea.Length;
            }
    
            Label1.Text += " Web: " + SPEncode.HtmlEncode(site.Name) + " Folder: " + 
                SPEncode.HtmlEncode(folder.Name) + " Number: " + folder.Files.Count + 
                " Size: " + totalFileSize + "<BR>";
        }
    }

    This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint, Microsoft.SharePoint.Utilities, and Microsoft.SharePoint.WebControls namespaces.

    The example assumes the existence of a .aspx page that contains a label control.

    Requirements

    Namespace: Microsoft.SharePoint

    Platforms: Microsoft Windows Server 2003

    Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

    Security: Code Access Security

    2006년 8월 23일 수요일 오전 2:54