VirtualPathProvider Klasa

Definicja

Udostępnia zestaw metod, które umożliwiają aplikacji internetowej pobieranie zasobów z wirtualnego systemu plików.

public ref class VirtualPathProvider abstract : MarshalByRefObject
public abstract class VirtualPathProvider : MarshalByRefObject
type VirtualPathProvider = class
    inherit MarshalByRefObject
Public MustInherit Class VirtualPathProvider
Inherits MarshalByRefObject
Dziedziczenie
VirtualPathProvider

Przykłady

Poniższy przykład kodu to implementacja VirtualPathProvider klasy, która tworzy wirtualny system plików przy użyciu informacji przechowywanych w DataSet obiekcie. Przykładowy kod współpracuje z przykładami kodu dla klas i VirtualDirectory w VirtualFile celu udostępnienia zasobów wirtualnych z magazynu danych załadowanego do DataSet obiektu.

W tym przykładzie znajdują się cztery części: VirtualPathProvider implementacja klasy, plik danych XML używany do wypełnienia DataSet obiektu, AppStart obiekt zawierający metodę służącą AppInitialize do rejestrowania VirtualPathProvider klasy w systemie kompilacji oraz stronę ASP.NET, która udostępnia linki do plików wirtualnych.

Aby użyć tego przykładowego kodu w aplikacji, wykonaj następujące kroki.

  1. Utwórz przykładową aplikację na serwerze sieci Web.

  2. Skopiuj kod źródłowy obiektu niestandardowego VirtualPathProvider (zobacz poniżej) do pliku w katalogu aplikacji App_Code .

  3. Skopiuj kod źródłowy dla obiektu niestandardowego VirtualDirectory (zobacz sekcję Przykład w VirtualDirectory temacie przeglądu klasy) do pliku w katalogu aplikacji App_Code .

  4. Skopiuj kod źródłowy dla obiektu niestandardowego VirtualFile (zobacz sekcję Przykład w VirtualFile temacie przeglądu klasy) do pliku w katalogu aplikacji App_Code .

  5. Skopiuj kod źródłowy obiektu AppStart (zobacz poniżej) do pliku w katalogu aplikacji App_Code .

  6. Skopiuj dane XML (zobacz poniżej) do pliku o nazwie XMLData.xml w pliku w katalogu aplikacji App_Data .

  7. default.aspx Skopiuj plik (zobacz poniżej) do katalogu głównego przykładowej aplikacji. Użyj przeglądarki sieci Web, aby otworzyć default.aspx plik, a następnie kliknij linki na stronie, aby wyświetlić zawartość plików wirtualnych.

Pierwszym przykładem jest klasa niestandardowa VirtualPathProvider . Metody DirectoryExists i FileExists są zastępowane, aby wskazać, czy żądany katalog znajduje się w wirtualnym systemie plików. Metody GetDirectory i GetFile są zastępowane w celu zwrócenia wystąpień niestandardowych VirtualDirectory i VirtualFile zawierających informacje z wirtualnego systemu plików.

Klasa udostępnia również metodę używaną GetVirtualData przez VirtualDirectory klasy i VirtualFile do uzyskiwania dostępu do DataSet obiektu zawierającego dane wirtualnego systemu plików. W implementacji produkcyjnej ta metoda jest zwykle implementowana w obiekcie biznesowym odpowiedzialnym za interakcję z magazynem danych.

using System;
using System.Data;
using System.Security.Permissions;
using System.Web;
using System.Web.Caching;
using System.Web.Hosting;

namespace Samples.AspNet.CS
{
  [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Medium)]
  [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.High)]
  public class SamplePathProvider : VirtualPathProvider
  {
    private string dataFile;

    public SamplePathProvider()
      : base()
    {
    }

    protected override void Initialize()
    {
      // Set the datafile path relative to the application's path.
      dataFile = HostingEnvironment.ApplicationPhysicalPath + "App_Data\\XMLData.xml";
    }

    /// <summary>
    ///   Data set provider for the SampleVirtualDirectory and
    ///   SampleVirtualFile classes. In a production application
    ///   this method would be on a provider class that accesses
    ///   the virtual resource data source.
    /// </summary>
    /// <returns>
    ///   The System.Data.DataSet containing the virtual resources 
    ///   provided by the SamplePathProvider.
    /// </returns>
    public DataSet GetVirtualData()
    {
      // Get the data from the cache.
      DataSet ds = (DataSet)HostingEnvironment.Cache.Get("VPPData");
      if (ds == null)
      {
        // Data not in cache. Read XML file.
        ds = new DataSet();
        ds.ReadXml(dataFile);

        // Make DataSet dependent on XML file.
        CacheDependency cd = new CacheDependency(dataFile);

        // Put DataSet into cache for maximum of 20 minutes.
        HostingEnvironment.Cache.Add("VPPData", ds, cd,
          Cache.NoAbsoluteExpiration,
          new TimeSpan(0, 20, 0),
          CacheItemPriority.Default, null);

        // Set data timestamp.
        DateTime dataTimeStamp = DateTime.Now;
        // Cache it so we can get the timestamp in later calls.
        HostingEnvironment.Cache.Insert("dataTimeStamp", dataTimeStamp, null,
          Cache.NoAbsoluteExpiration,
          new TimeSpan(0, 20, 0),
          CacheItemPriority.Default, null);
      }
      return ds;
    }

    /// <summary>
    ///   Determines whether a specified virtual path is within
    ///   the virtual file system.
    /// </summary>
    /// <param name="virtualPath">An absolute virtual path.</param>
    /// <returns>
    ///   true if the virtual path is within the 
    ///   virtual file sytem; otherwise, false.
    /// </returns>
    private bool IsPathVirtual(string virtualPath)
    {
      String checkPath = VirtualPathUtility.ToAppRelative(virtualPath);
      return checkPath.StartsWith("~/vrdir", StringComparison.InvariantCultureIgnoreCase);
    }

    public override bool FileExists(string virtualPath)
    {
      if (IsPathVirtual(virtualPath))
      {
        SampleVirtualFile file = (SampleVirtualFile)GetFile(virtualPath);
        return file.Exists;
      }
      else
            {
                return Previous.FileExists(virtualPath);
            }
        }

    public override bool DirectoryExists(string virtualDir)
    {
      if (IsPathVirtual(virtualDir))
      {
        SampleVirtualDirectory dir = (SampleVirtualDirectory)GetDirectory(virtualDir);
        return dir.Exists;
      }
      else
            {
                return Previous.DirectoryExists(virtualDir);
            }
        }

    public override VirtualFile GetFile(string virtualPath)
    {
      if (IsPathVirtual(virtualPath))
        return new SampleVirtualFile(virtualPath, this);
      else
        return Previous.GetFile(virtualPath);
    }

    public override VirtualDirectory GetDirectory(string virtualDir)
    {
      if (IsPathVirtual(virtualDir))
        return new SampleVirtualDirectory(virtualDir, this);
      else
        return Previous.GetDirectory(virtualDir);
    }

    public override CacheDependency GetCacheDependency(
      string virtualPath, 
      System.Collections.IEnumerable virtualPathDependencies, 
      DateTime utcStart)
    {
      if (IsPathVirtual(virtualPath))
      {
        System.Collections.Specialized.StringCollection fullPathDependencies = null;

        // Get the full path to all dependencies.
        foreach (string virtualDependency in virtualPathDependencies)
        {
          if (fullPathDependencies == null)
            fullPathDependencies = new System.Collections.Specialized.StringCollection();

          fullPathDependencies.Add(virtualDependency);
        }
        if (fullPathDependencies == null)
          return null;

        // Copy the list of full-path dependencies into an array.
        string[] fullPathDependenciesArray = new string[fullPathDependencies.Count];
        fullPathDependencies.CopyTo(fullPathDependenciesArray, 0);
        // Copy the virtual path into an array.
        string[] virtualPathArray = new string[1];
        virtualPathArray[0] = virtualPath;

        return new CacheDependency(virtualPathArray, fullPathDependenciesArray, utcStart);
      }
      else
            {
                return Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
            }
        }
  }
}

Imports System.Data
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.Caching
Imports System.Web.Hosting


Namespace Samples.AspNet.VB
  <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Medium), _
   AspNetHostingPermission(SecurityAction.InheritanceDemand, level:=AspNetHostingPermissionLevel.High)> _
  Public Class SamplePathProvider
    Inherits VirtualPathProvider

    Private dataFile As String

    Public Sub New()
      MyBase.New()
    End Sub

    Protected Overrides Sub Initialize()
      ' Set the datafile path relative to the application's path.
      dataFile = HostingEnvironment.ApplicationPhysicalPath & _
        "App_Data\XMLData.xml"
    End Sub

    '   Data set provider for the SampleVirtualFile and
    '   SampleVirtualDirectory classes. In a production application
    '   this method would be on a provider class that accesses
    '   the virtual resource data source.
    '   The System.Data.DataSet containing the virtual resources
    '   provided by the SamplePathProvider.
    Public Function GetVirtualData() As DataSet
      ' Get the data from the cache.
      Dim ds As DataSet
      ds = CType(HostingEnvironment.Cache.Get("VPPData"), DataSet)

      If ds Is Nothing Then
        ' Data set not in cache. Read XML file.
        ds = New DataSet
        ds.ReadXml(dataFile)

        ' Make DataSet dependent on XML file.
        Dim cd As CacheDependency
        cd = New CacheDependency(dataFile)

        ' Put DataSet into cache for maximum of 20 minutes.
        HostingEnvironment.Cache.Add("VPPData", ds, cd, _
         Cache.NoAbsoluteExpiration, _
         New TimeSpan(0, 20, 0), _
         CacheItemPriority.Default, Nothing)

        ' Set data timestamp.
        Dim dataTimeStamp As DateTime
        dataTimeStamp = DateTime.Now
        ' Cache it so we can get the timestamp in later calls.
        HostingEnvironment.Cache.Add("dataTimeStamp", dataTimeStamp, Nothing, _
          Cache.NoAbsoluteExpiration, _
          New TimeSpan(0, 20, 0), _
          CacheItemPriority.Default, Nothing)
      End If
      Return ds
    End Function

    Private Function IsPathVirtual(ByVal virtualPath As String) As Boolean
      Dim checkPath As String
      checkPath = VirtualPathUtility.ToAppRelative(virtualPath)
      Return checkPath.StartsWith("~/vrdir", StringComparison.InvariantCultureIgnoreCase)
    End Function

    Public Overrides Function FileExists(ByVal virtualPath As String) As Boolean
      If (IsPathVirtual(virtualPath)) Then
        Dim file As SampleVirtualFile
        file = CType(GetFile(virtualPath), SampleVirtualFile)
        Return file.Exists
      Else
        Return Previous.FileExists(virtualPath)
      End If
    End Function

    Public Overrides Function DirectoryExists(ByVal virtualDir As String) As Boolean
      If (IsPathVirtual(virtualDir)) Then
        Dim dir As SampleVirtualDirectory
        dir = CType(GetDirectory(virtualDir), SampleVirtualDirectory)
        Return dir.exists
      Else
        Return Previous.DirectoryExists(virtualDir)
      End If
    End Function

    Public Overrides Function GetFile(ByVal virtualPath As String) As VirtualFile
      If (IsPathVirtual(virtualPath)) Then
        Return New SampleVirtualFile(virtualPath, Me)
      Else
        Return Previous.GetFile(virtualPath)
      End If
    End Function

    Public Overrides Function GetDirectory(ByVal virtualDir As String) As VirtualDirectory
      If (IsPathVirtual(virtualDir)) Then
        Return New SampleVirtualDirectory(virtualDir, Me)
      Else
        Return Previous.GetDirectory(virtualDir)
      End If
    End Function

    Public Overrides Function GetCacheDependency(ByVal virtualPath As String, ByVal virtualPathDependencies As IEnumerable, ByVal utcStart As Date) As CacheDependency
      If (IsPathVirtual(virtualPath)) Then

        Dim fullPathDependencies As System.Collections.Specialized.StringCollection
        fullPathDependencies = Nothing

        ' Get the full path to all dependencies.
        For Each virtualDependency As String In virtualPathDependencies
          If fullPathDependencies Is Nothing Then
            fullPathDependencies = New System.Collections.Specialized.StringCollection
          End If

          fullPathDependencies.Add(virtualDependency)
        Next

        If fullPathDependencies Is Nothing Then
          Return Nothing
        End If

        Dim fullPathDependenciesArray As String()
        fullPathDependencies.CopyTo(fullPathDependenciesArray, 0)

        Return New CacheDependency(fullPathDependenciesArray, utcStart)
      Else
        Return Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart)
      End If
    End Function
  End Class
End Namespace

Drugim przykładem jest plik danych XML używany do wypełniania DataSet obiektu zwróconego przez obiekt niestandardowy VirtualPathProvider . Te dane XML służą do demonstrowania przy użyciu VirtualPathProviderobiektów , VirtualDirectoryi VirtualFile do pobierania danych z danych zewnętrznych i nie są przeznaczone do reprezentowania magazynu danych jakości produkcyjnej.

<?xml version="1.0" encoding="utf-8" ?>  
  <resource type="dir"   
    path="/vrDir"   
    parentPath=""   
    content="">  
    <resource type="file"   
      path="/vrDir/Level1FileA.vrf"  
      parentPath="/vrDir"   
      content="This is the content of file Level1FileA.">  
    </resource>  
    <resource type="file"   
      path="/vrDir/Level1FileB.vrf"  
      parentPath="/vrDir"   
      content="This is the content of file Level1FileB.">  
    </resource>  
    <resource type="dir"   
      path="/vrDir/Level2DirA"   
      parentPath="/vrDir"   
      content="">  
    <resource type="file"   
      path="/vrDir/Level2DirA/Level2FileA.vrf"   
      parentPath="/vrDir/Level2DirA"   
      content="This is the content of file Level2FileA.">  
    </resource>  
    <resource type="file"   
      path="/vrDir/Level2DirA/Level2FileB.vrf"  
      parentPath="/vrDir/Level2DirA"   
      content="This is the content of file Level2FileB.">  
    </resource>  
  </resource>  
  <resource type="dir"   
    path="/vrDir/Level2DirB"   
    parentPath="/vrDir"   
    content="">  
    <resource type="file"   
      path="/vrDir/Level2DirB/Level2FileA.vrf"   
      parentPath="/vrDir/Level2DirB"   
      content="This is the content of file Level2FileA.">  
    </resource>  
    <resource type="file"   
      path="/vrDir/Level2DirB/Level2FileB.vrf"  
      parentPath="/vrDir/Level2DirB"   
      content="This is the content of file Level2FileB.">  
    </resource>  
  </resource>  
</resource>  

Trzeci przykład zawiera AppStart obiekt zawierający metodę AppInitialize . Ta metoda jest wywoływana podczas inicjowania aplikacji ASP.NET w celu wykonania dowolnej wymaganej niestandardowej inicjowania. W takim przypadku rejestruje obiekt niestandardowy VirtualPathProvider w systemie kompilacji ASP.NET.

using System.Web.Hosting;

namespace Samples.AspNet.CS
{
  /// <summary>
  ///   Contains the application initialization method
  ///   for the sample application.
  /// </summary>
  public static class AppStart
  {
    public static void AppInitialize()
    {
      SamplePathProvider sampleProvider = new SamplePathProvider();
      HostingEnvironment.RegisterVirtualPathProvider(sampleProvider);
    } 
  }
}

Imports System.Web.Hosting

Namespace Samples.AspNet.VB

  Public Class AppStart

    Public Shared Sub AppInitialize()
      Dim sampleProvider As SamplePathProvider = New SamplePathProvider()
      HostingEnvironment.RegisterVirtualPathProvider(sampleProvider)
    End Sub

  End Class
End Namespace

Ostatnim przykładem jest strona ASP.NET zawierająca linki do plików wirtualnych zawartych w wirtualnym systemie plików.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <meta http-equiv="Content-Type" content="text/html" />
  <title>Virtual Path Provider Example</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:HyperLink ID="hyperLink1" runat="server" NavigateUrl="vrDir/Level1FileA.vrf" Text="Level 1, File A" /><br />
    <asp:HyperLink ID="hyperLink2" runat="server" NavigateUrl="vrDir/Level1FileB.vrf" Text="Level 1, File B" /><br />
    <asp:HyperLink ID="hyperLink3" runat="server" NavigateUrl="vrDir/Level2DirA/Level2FileA.vrf" Text="Level 2a, File A" /><br />
    <asp:HyperLink ID="hyperLink4" runat="server" NavigateUrl="vrDir/Level2DirA/Level2FileB.vrf" Text="Level 2a, File B" /><br />
    <asp:HyperLink ID="hyperLink5" runat="server" NavigateUrl="vrDir/Level2DirB/Level2FileA.vrf" Text="Level 2b, File A" /><br />
    <asp:HyperLink ID="hyperLink6" runat="server" NavigateUrl="vrDir/Level2DirB/Level2FileB.vrf" Text="Level 2b, File B" /><br />
  </form>
</body>
</html>
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <meta http-equiv="Content-Type" content="text/html" />
  <title>Virtual Path Provider Example</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:HyperLink ID="hyperLink1" runat="server" NavigateUrl="vrDir/Level1FileA.vrf" Text="Level 1, File A" /><br />
    <asp:HyperLink ID="hyperLink2" runat="server" NavigateUrl="vrDir/Level1FileB.vrf" Text="Level 1, File B" /><br />
    <asp:HyperLink ID="hyperLink3" runat="server" NavigateUrl="vrDir/Level2DirA/Level2FileA.vrf" Text="Level 2a, File A" /><br />
    <asp:HyperLink ID="hyperLink4" runat="server" NavigateUrl="vrDir/Level2DirA/Level2FileB.vrf" Text="Level 2a, File B" /><br />
    <asp:HyperLink ID="hyperLink5" runat="server" NavigateUrl="vrDir/Level2DirB/Level2FileA.vrf" Text="Level 2b, File A" /><br />
    <asp:HyperLink ID="hyperLink6" runat="server" NavigateUrl="vrDir/Level2DirB/Level2FileB.vrf" Text="Level 2b, File B" /><br />
  </form>
</body>
</html>

Uwagi

Klasa VirtualPathProvider udostępnia zestaw metod implementowania wirtualnego systemu plików dla aplikacji internetowej. W wirtualnym systemie plików pliki i katalogi są zarządzane przez magazyn danych inny niż system plików udostępniany przez system operacyjny serwera. Na przykład można użyć wirtualnego systemu plików do przechowywania zawartości w bazie danych SQL Server.

Można przechowywać dowolny plik przetwarzany na żądanie w wirtualnym systemie plików. Obejmuje on:

  • ASP.NET stron, stron wzorcowych, kontrolek użytkownika i innych obiektów.

  • Standardowe strony sieci Web z rozszerzeniami, takimi jak .htm i .jpg.

  • Dowolne rozszerzenie niestandardowe mapowane na BuildProvider wystąpienie.

  • Dowolny nazwany motyw w folderze App_Theme .

Nie można przechowywać ASP.NET folderów aplikacji lub plików, które generują zestawy na poziomie aplikacji w wirtualnym systemie plików. Obejmuje on:

  • Plik Global.asax.

  • Web.config plików.

  • Pliki danych mapy witryny używane przez usługę XmlSiteMapProvider.

  • Katalogi zawierające zestawy aplikacji lub generujące zestawy aplikacji: Bin, App_Code, App_GlobalResources, dowolne App_LocalResources.

  • Folder danych aplikacji , App_Data.

Uwaga

Jeśli witryna sieci Web jest wstępnie skompilowana do wdrożenia, zawartość dostarczana przez VirtualPathProvider wystąpienie nie jest kompilowana, a żadne wystąpienia nie VirtualPathProvider są używane przez wstępnie skompilowaną witrynę.

Rejestrowanie składnika VirtualPathProvider

Wystąpienie niestandardowe VirtualPathProvider powinno zostać zarejestrowane w systemie kompilacji ASP.NET przy użyciu HostingEnvironment.RegisterVirtualPathProvider metody przed wykonaniem analizy lub kompilacji strony przez aplikację internetową.

VirtualPathProvider Zazwyczaj wystąpienie jest rejestrowane w metodzie zdefiniowanej AppInitializeApp_Code w katalogu lub podczas Application_Start zdarzenia w Global.asax pliku. Przykład rejestrowania VirtualPathProvider wystąpienia w metodzie AppInitialize można znaleźć w sekcji Przykład.

Wystąpienie można zarejestrować VirtualPathProvider podczas innych zdarzeń, ale strony skompilowane i buforowane przed VirtualPathProvider zarejestrowaniem wystąpienia nie zostaną unieważnione, nawet jeśli nowe VirtualPathProvider wystąpienie zapewni teraz źródło dla wcześniej skompilowanej strony.

Uwagi dotyczące implementowania

Po dziedziczeniu z VirtualPathProviderprogramu należy zastąpić następujące elementy członkowskie:

Jeśli klasa niestandardowa VirtualPathProvider obsługuje katalogi w wirtualnym systemie plików, należy zastąpić następujące elementy członkowskie.

Konstruktory

VirtualPathProvider()

Inicjuje klasę do użycia przez dziedziczone wystąpienie klasy. Ten konstruktor może być wywoływany tylko przez dziedziczonej klasy.

Właściwości

Previous

Pobiera odwołanie do wcześniej zarejestrowanego VirtualPathProvider obiektu w systemie kompilacji.

Metody

CombineVirtualPaths(String, String)

Łączy ścieżkę podstawową ze ścieżką względną, aby zwrócić pełną ścieżkę do zasobu wirtualnego.

CreateObjRef(Type)

Tworzy obiekt zawierający wszystkie istotne informacje wymagane do wygenerowania serwera proxy używanego do komunikowania się z obiektem zdalnym.

(Odziedziczone po MarshalByRefObject)
DirectoryExists(String)

Pobiera wartość wskazującą, czy katalog istnieje w wirtualnym systemie plików.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
FileExists(String)

Pobiera wartość wskazującą, czy plik istnieje w wirtualnym systemie plików.

GetCacheDependency(String, IEnumerable, DateTime)

Tworzy zależność pamięci podręcznej na podstawie określonych ścieżek wirtualnych.

GetCacheKey(String)

Zwraca klucz pamięci podręcznej do użycia dla określonej ścieżki wirtualnej.

GetDirectory(String)

Pobiera katalog wirtualny z wirtualnego systemu plików.

GetFile(String)

Pobiera plik wirtualny z wirtualnego systemu plików.

GetFileHash(String, IEnumerable)

Zwraca skrót określonych ścieżek wirtualnych.

GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetLifetimeService()
Przestarzałe.

Pobiera bieżący obiekt usługi okresu istnienia, który kontroluje zasady okresu istnienia dla tego wystąpienia.

(Odziedziczone po MarshalByRefObject)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
Initialize()

Inicjuje VirtualPathProvider wystąpienie.

InitializeLifetimeService()

VirtualPathProvider Daje obiektowi nieskończony okres istnienia, uniemożliwiając utworzenie dzierżawy.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
MemberwiseClone(Boolean)

Tworzy płytkią kopię bieżącego MarshalByRefObject obiektu.

(Odziedziczone po MarshalByRefObject)
OpenFile(String)

Zwraca strumień z pliku wirtualnego.

ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy