تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مساعدة في عمل برنامج
#1
السلام عليكم اخواني اود عمل برنامج وانا احتاج الى مساعدتكم حفظكم الله لكوني مبتدى قليلا في البرمجة على vb.net 

الله يجازي كل من يعطي فكرة في هذا الصدد وسأضل ادعو له في كل صلاة
سرد الاشكال طويل قليلا لذا فضلت ارفاقه في  المرفقات ملف pdf مع الملفات المطلوبة للبرنامج 


الملفات المرفقة
.pdf   طلب برنامج.pdf (الحجم : 698.06 ك ب / التحميلات : 81)
.rar   ملفات العمل.rar (الحجم : 4.28 م ب / التحميلات : 43)
الرد }}}
تم الشكر بواسطة:
#2
ارجو الرد من الاخوة قريبا على موضوعي
الرد }}}
تم الشكر بواسطة:
#3
اخوي هذا ما اتسع الوقت لعمله بدون جزئية "الملفات الجزئية المراد استخراجها "

قد يكون الكود صعب فهمه
PHP كود :
Imports System.Text.RegularExpressions
Imports System
.ComponentModel

Public Class Form1

    Dim WithEvents backwork 
As New BackgroundWorker
    Dim Status 
As New StatusStrip
    Dim StatusLabel 
= New ToolStripStatusLabel() With {.Text "Ready."}
 
   Dim StatusProgressBar As New ToolStripProgressBar() With {.Style ProgressBarStyle.Marquee, .Visible False, .MarqueeAnimationSpeed 1}

 
   Private Sub Form1_Load(sender As System.ObjectAs System.EventArgsHandles MyBase.Load
        Control
.CheckForIllegalCrossThreadCalls False
        Me
.Status.Items.Add(StatusProgressBar)
 
       Me.Status.Items.Add(StatusLabel)
 
       Me.Controls.Add(Status)
 
       '----------------------
        Me.TextBox1.ReadOnly = True
        Me.TextBox2.ReadOnly = True
    End Sub

    Dim الملف_الرئيسي As String
    Dim مرجع_التقسيم As String

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Using o As New OpenFileDialog
            o.Filter = "Text files (*.txt)|*.txt"
            If o.ShowDialog = Windows.Forms.DialogResult.OK Then
                الملف_الرئيسي = o.FileName
                TextBox1.Text = IO.Path.GetFileName(o.FileName)
            End If
        End Using
    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Using o As New OpenFileDialog
            o.Filter = "Text files (*.txt)|*.txt"
            If o.ShowDialog = Windows.Forms.DialogResult.OK Then
                مرجع_التقسيم = o.FileName
                TextBox2.Text = IO.Path.GetFileName(o.FileName)

                Me.Button1.Enabled = False
                Me.Button2.Enabled = False
                Me.TextBox1.Enabled = False
                Me.TextBox2.Enabled = False
                Me.TextBox3.Enabled = False
                Me.TextBox4.Enabled = False
                Me.ListBox1.Items.Clear()

                StatusProgressBar.Visible = True

                backwork.RunWorkerAsync()

            End If
        End Using
    End Sub

    Private Sub backwork_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles backwork.DoWork
        Try
            Dim sourceLines() As String = IO.File.ReadAllLines(الملف_الرئيسي)

            ' 
header ------------------------------
 
           Me.StatusLabel.Text "header working..."
 
           Dim header(1) As String
            Array
.Copy(sourceLines0header07)
 
           Me.StatusLabel.Text "header completed"

 
           ' details -----------------------------
            Me.StatusLabel.Text = "details working..."
            Dim details(sourceLines.Count - 7 - 1) As String
            Array.Copy(sourceLines, 7, details, 0, sourceLines.Count - 7)

            For i = 0 To details.Length - 1
                details(i) = details(i).Substring(9, 4) & " - " & details(i)
            Next
            Array.Sort(details)
            For i = 0 To details.Length - 1
                details(i) = details(i).Substring(7)
            Next
            Me.StatusLabel.Text = "header completed"


            '
splitfiles ---------------------------------------------
 
           Dim files() As String IO.File.ReadAllLines(مرجع_التقسيم)
 
           For Each f As String In files
                If f
.Trim <> "" Then
                    Dim filename 
As String f.Substring(08)
 
                   Me.StatusLabel.Text filename " working..."
 
                   Dim flagStart As Integer Val(f.Substring(94))
 
                   Dim flagEnd As Integer Val(f.Substring(144))
 
                   Dim flagCount As Integer Val(f.Substring(19))
 
                   Dim range Enumerable.Range(flagStartflagEnd flagStart 1)
 
                   Dim RegexPattern As String "^\w(\d{3})\s\d{4}(" String.Join("|"range) & ")\s.+"

 
                   Dim ms As MatchCollection Regex.Matches(String.Join(vbNewLinedetails), RegexPatternRegexOptions.Multiline)
 
                   Dim resultLines = (From x As Match In ms Select x.Value).ToArray

                    If flagCount 
<> ms.Count Then
                        ListBox1
.Items.Add(filename)
 
                   End If

 
                   Dim resultFile As String String.Empty
 
                   resultFile &= "date: xxxxxxxxx" vbNewLine
                    resultFile 
&= "mois:  xxxxxxxxxx " vbNewLine
                    resultFile 
&= "project: xxxxxxxxx" vbNewLine
                    resultFile 
&= "observation: xxxxxxxx" vbNewLine
                    resultFile 
&= "unti: xxxxxxxxxxxxxxx" vbNewLine
                    resultFile 
&= "" vbNewLine
                    resultFile 
&= "" vbNewLine

                    resultFile 
&= String.Join(vbNewLineresultLines) & vbNewLine

                    IO
.File.WriteAllText(filename ".txt"resultFile)
 
                   Me.StatusLabel.Text filename " completed"
 
               End If
 
           Next
            Me
.StatusLabel.Text "Successful."

 
       Catch ex As Exception
            Me
.StatusLabel.Text "Error."
 
           MsgBox(ex.Message)
 
       End Try
 
       StatusProgressBar.Visible False

        Me
.Button1.Enabled True
        Me
.Button2.Enabled True
        Me
.TextBox1.Enabled True
        Me
.TextBox2.Enabled True
        Me
.TextBox3.Enabled True
        Me
.TextBox4.Enabled True

    End Sub


End 
Class 

حاولت اجمع اكواد من المنتدى تساعد
اخي استفد من الاكواد بتعديلها بما يحقق مطلبك
الرد }}}
تم الشكر بواسطة: rabeh.ram , Amir_Alzubidy
#4
جزاك الله الف خير اخي السرور وانعم عليك من خيراته دائما انت متميز ولاتبخل علينا بردودك الله يعطيك ما تتمنى
الرد }}}
تم الشكر بواسطة:



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


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم