تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مساعدة في إنشاء ملف نصي
#2
تعديل الكود

        Using Dilaoge As New SaveFileDialog
            Dilaoge.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
            If Dilaoge.ShowDialog() = Windows.Forms.DialogResult.OK Then
                Dim NomFechiers As String = Dilaoge.FileName
                Dim StreamW As StreamWriter = File.CreateText(NomFechiers)

                Dim total = (From x As DataGridViewRow In DGView.Rows Select CDbl(x.Cells(4).Value)).Sum
                StreamW.WriteLine("" & DGView.RowCount & "" & Today.ToLongDateString & "" & FormatNumber(total))

                Dim Cellule1, Cellule2, Cellule3, Cellule4 As String
                For i As Integer = 0 To DGView.Rows.Count - 1
                    Cellule2 = (DGView.Rows(i).Cells(2).Value.ToString().PadLeft(5, "0") & "")
                    Cellule3 = (DGView.Rows(i).Cells(3).Value.ToString() & "")
                    Cellule4 = (DGView.Rows(i).Cells(4).Value.ToString() & "")
                    Cellule1 = (DGView.Rows(i).Cells(1).Value.ToString().PadLeft(27))
                    StreamW.Write(Cellule2 & "" & Cellule3 & "" & GetFormatNumber(Cellule4) & "" & Cellule1)
                    StreamW.WriteLine("")
                Next
                StreamW.Close()
                MessageBox.Show("تمت عملية الحفظ بنجاح")
            End If
        End Using
الرد }}}
تم الشكر بواسطة: حريف برمجة


الردود في هذا الموضوع
مساعدة في إنشاء ملف نصي - بواسطة ahmedfa71 - 21-03-19, 12:36 PM
RE: مساعدة في إنشاء ملف نصي - بواسطة 5000 - 21-03-19, 03:24 PM
RE: مساعدة في إنشاء ملف نصي - بواسطة ahmedfa71 - 21-03-19, 05:22 PM


التنقل السريع :


يقوم بقرائة الموضوع: