2012'den beri808 mesaj
Bu Kodlarla DataGridview'de Word Dosyasının Property Gösterebiliyorum
Peki dataGridView1'den Örneğin Yazarını Değiştirdim Diyelim Nasıl Kayıtlı Kalmasını Sağlayabilirim Bu Değişikliğin
private FileInfo SelectedFileInfo;
private void listView1_SelectedIndexChanged_1(object sender, EventArgs e)
{
if (listViewFileInfoList.SelectedItems.Count > 0)
{
string FileName = listViewFileInfoList.SelectedItems[0].SubItems[0].Text;
string Path = listViewFileInfoList.SelectedItems[0].SubItems[1].Text;
string LastWriteTime = listViewFileInfoList.SelectedItems[0].SubItems[2].Text;
string Extension = listViewFileInfoList.SelectedItems[0].SubItems[6].Text;
string IsReadOnly = listViewFileInfoList.SelectedItems[0].SubItems[4].Text;
string CreationTime = listViewFileInfoList.SelectedItems[0].SubItems[5].Text;
SelectedFileInfo = new FileInfo(Path + "\\" + FileName);
if (SelectedFileInfo.Extension == ".doc" || SelectedFileInfo.Extension == ".docx")
{
DSOFile.OleDocumentProperties doc = new DSOFile.OleDocumentProperties();
doc.Open(SelectedFileInfo.FullName, false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
dataGridView1.Rows.Clear();
DataGridViewRow row1 = new DataGridViewRow();
row1.CreateCells(dataGridView1);
row1.Cells[0].Value = "Konu";
row1.Cells[1].Value = doc.SummaryProperties.Subject;
dataGridView1.Rows.Add(row1);
DataGridViewRow row2 = new DataGridViewRow();
row2.CreateCells(dataGridView1);
row2.Cells[0].Value = "Kategorisi";
row2.Cells[1].Value = doc.SummaryProperties.Category;
dataGridView1.Rows.Add(row2);
DataGridViewRow row3 = new DataGridViewRow();
row3.CreateCells(dataGridView1);
row3.Cells[0].Value = "Yazar";
row3.Cells[1].Value = doc.SummaryProperties.Author;
dataGridView1.Rows.Add(row3);
DataGridViewRow row4 = new DataGridViewRow();
row4.CreateCells(dataGridView1);
row4.Cells[0].Value = "Son Kaydeden";
row4.Cells[1].Value = doc.SummaryProperties.LastSavedBy;
dataGridView1.Rows.Add(row4);
dataGridView1.Update();
DataGridViewRow row5 = new DataGridViewRow();
row5.CreateCells(dataGridView1);
row5.Cells[0].Value = "Yorumlar";
row5.Cells[1].Value = doc.SummaryProperties.Comments ;
dataGridView1.Rows.Add(row5);
DataGridViewRow row6 = new DataGridViewRow();
row6.CreateCells(dataGridView1);
row6.Cells[0].Value = "Revizyon Numarası";
row6.Cells[1].Value = doc.SummaryProperties.RevisionNumber;
dataGridView1.Rows.Add(row6);
DataGridViewRow row7 = new DataGridViewRow();
row7.CreateCells(dataGridView1);
row7.Cells[0].Value = "Şirket";
row7.Cells[1].Value = doc.SummaryProperties.Company;
dataGridView1.Rows.Add(row7);
DataGridViewRow row8 = new DataGridViewRow();
row8.CreateCells(dataGridView1);
row8.Cells[0].Value = "Son Kaydedilme Tarihi";
row8.Cells[1].Value = doc.SummaryProperties.DateLastSaved;
dataGridView1.Rows.Add(row8);
DataGridViewRow row9 = new DataGridViewRow();
row9.CreateCells(dataGridView1);
row9.Cells[0].Value = "Sayfa Sayısı";
row5.Cells[1].Value = doc.SummaryProperties.PageCount;
dataGridView1.Rows.Add(row9);
DataGridViewRow row0 = new DataGridViewRow();
row0.CreateCells(dataGridView1);
row0.Cells[0].Value = "Boyut";
row0.Cells[1].Value = doc.SummaryProperties.Version + " Byte";
dataGridView1.Rows.Add(row0);
Peki dataGridView1'den Örneğin Yazarını Değiştirdim Diyelim Nasıl Kayıtlı Kalmasını Sağlayabilirim Bu Değişikliğin
private FileInfo SelectedFileInfo;
private void listView1_SelectedIndexChanged_1(object sender, EventArgs e)
{
if (listViewFileInfoList.SelectedItems.Count > 0)
{
string FileName = listViewFileInfoList.SelectedItems[0].SubItems[0].Text;
string Path = listViewFileInfoList.SelectedItems[0].SubItems[1].Text;
string LastWriteTime = listViewFileInfoList.SelectedItems[0].SubItems[2].Text;
string Extension = listViewFileInfoList.SelectedItems[0].SubItems[6].Text;
string IsReadOnly = listViewFileInfoList.SelectedItems[0].SubItems[4].Text;
string CreationTime = listViewFileInfoList.SelectedItems[0].SubItems[5].Text;
SelectedFileInfo = new FileInfo(Path + "\\" + FileName);
if (SelectedFileInfo.Extension == ".doc" || SelectedFileInfo.Extension == ".docx")
{
DSOFile.OleDocumentProperties doc = new DSOFile.OleDocumentProperties();
doc.Open(SelectedFileInfo.FullName, false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
dataGridView1.Rows.Clear();
DataGridViewRow row1 = new DataGridViewRow();
row1.CreateCells(dataGridView1);
row1.Cells[0].Value = "Konu";
row1.Cells[1].Value = doc.SummaryProperties.Subject;
dataGridView1.Rows.Add(row1);
DataGridViewRow row2 = new DataGridViewRow();
row2.CreateCells(dataGridView1);
row2.Cells[0].Value = "Kategorisi";
row2.Cells[1].Value = doc.SummaryProperties.Category;
dataGridView1.Rows.Add(row2);
DataGridViewRow row3 = new DataGridViewRow();
row3.CreateCells(dataGridView1);
row3.Cells[0].Value = "Yazar";
row3.Cells[1].Value = doc.SummaryProperties.Author;
dataGridView1.Rows.Add(row3);
DataGridViewRow row4 = new DataGridViewRow();
row4.CreateCells(dataGridView1);
row4.Cells[0].Value = "Son Kaydeden";
row4.Cells[1].Value = doc.SummaryProperties.LastSavedBy;
dataGridView1.Rows.Add(row4);
dataGridView1.Update();
DataGridViewRow row5 = new DataGridViewRow();
row5.CreateCells(dataGridView1);
row5.Cells[0].Value = "Yorumlar";
row5.Cells[1].Value = doc.SummaryProperties.Comments ;
dataGridView1.Rows.Add(row5);
DataGridViewRow row6 = new DataGridViewRow();
row6.CreateCells(dataGridView1);
row6.Cells[0].Value = "Revizyon Numarası";
row6.Cells[1].Value = doc.SummaryProperties.RevisionNumber;
dataGridView1.Rows.Add(row6);
DataGridViewRow row7 = new DataGridViewRow();
row7.CreateCells(dataGridView1);
row7.Cells[0].Value = "Şirket";
row7.Cells[1].Value = doc.SummaryProperties.Company;
dataGridView1.Rows.Add(row7);
DataGridViewRow row8 = new DataGridViewRow();
row8.CreateCells(dataGridView1);
row8.Cells[0].Value = "Son Kaydedilme Tarihi";
row8.Cells[1].Value = doc.SummaryProperties.DateLastSaved;
dataGridView1.Rows.Add(row8);
DataGridViewRow row9 = new DataGridViewRow();
row9.CreateCells(dataGridView1);
row9.Cells[0].Value = "Sayfa Sayısı";
row5.Cells[1].Value = doc.SummaryProperties.PageCount;
dataGridView1.Rows.Add(row9);
DataGridViewRow row0 = new DataGridViewRow();
row0.CreateCells(dataGridView1);
row0.Cells[0].Value = "Boyut";
row0.Cells[1].Value = doc.SummaryProperties.Version + " Byte";
dataGridView1.Rows.Add(row0);
