Dosyaları Açmanın Farklı Yolları
Contents
[
Hide
]
Aspose.Cells ile dosyaları açmak, örneğin verileri almak veya geliştirme sürecini hızlandırmak için bir tasarımcı şablonu kullanmak mümkündür. Aspose.Cells, Microsoft Excel elektronik tabloları (XLS, XLSX, XLSM, XLSB), CSV veya TabDelimited dosyaları gibi bir dizi farklı dosyayı açabilir.
Yol Yoluyla Dosya Açma
Geliştiriciler, dosya yolunu kullanarak bir Microsoft Excel dosyasını yerel bilgisayarda belirterek açabilirler.IÇalışma Kitabısınıf oluşturucu Yapıcıdaki yolu String olarak geçirmeniz yeterlidir. Aspose.Cells, dosya biçimi türünü otomatik olarak algılar.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C | |
//Source directory path | |
StringPtr dirPath = new String("..\\Data\\LoadingSavingAndConverting\\"); | |
//Create Workbook object from an Excel file path | |
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(dirPath->StringAppend(new String("sampleExcelFile.xlsx"))); | |
//Show following message on console | |
Console::WriteLine(new String("Workbook opened successfully using file path.")); |
Akış Kullanarak Dosya Açma
Bir Excel dosyasını akış olarak açmak da mümkündür. Bunu yapmak için, yapıcının aşırı yüklenmiş bir sürümünü kullanın.Aktarımdosyayı içeren nesne.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C | |
//Source directory path | |
StringPtr dirPath = new String("..\\Data\\LoadingSavingAndConverting\\"); | |
//Create a Stream object | |
intrusive_ptr<FileStream> fstream = new FileStream(dirPath->StringAppend(new String("sampleExcelFile.xlsx")), FileMode_Open); | |
//Create Workbook object from a Stream object | |
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(fstream); | |
//Show following message on console | |
Console::WriteLine(new String("Workbook opened successfully using stream.")); | |
//Close the Stream object | |
fstream->Close(); |