S҂̂\[X̂͂@B
ǂł炵ĂƂꂵłB
Tips̋lߍ킹ϐFXłB

Imports System.IO
Public Class Form1
    Dim FP As String = System.IO.Directory.GetCurrentDirectory()
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'OpenFileDialogNX̃CX^X쐬
        Dim dckaly As New ArrayList
        Dim ngdckaly As New ArrayList
        Dim i As Integer = 0
        Dim str As String
        Dim ary As New ArrayList


        '    'OK{^NbNꂽƂ
        'Iꂽt@C\
        'Console.WriteLine(ofd.FileName)
        Dim nglst As New System.IO.StreamReader(FP & "\NGlist.txt", System.Text.Encoding.GetEncoding("shift_jis"))

        While nglst.Peek() > -1
            ary.Add(nglst.ReadLine())
        End While
        Dim rs As New System.IO.StringReader(DeckList_txt.Text)

        While rs.Peek > -1
            'esǂݍ
            str = rs.ReadLine()
            For Each chk As String In ary
                If HasString(str, chk) = True Then
                    TextBox1.Text &= str & vbCrLf
                End If
            Next
        End While
        '
        rs.Close()
        nglst.Close()

    End Sub

    Public Function HasString(ByVal target As String, ByVal word As String) As Boolean
        If word = "" Then
            Return False
        End If
        If target = "" Then
            Return False
        End If
        target = StrConv(UCase(target), VbStrConv.Narrow)
        word = StrConv(UCase(word), VbStrConv.Narrow)

        If target.IndexOf(word) >= 0 Then
            Return True
        Else
            Return False
        End If
    End Function

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.Text = "fbLǂݍ" & vbCrLf & "֎~J[h`FbN"
    End Sub

    Private Sub EToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub eLXg{bNX̃NAToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles eLXg{bNX̃NAToolStripMenuItem.Click
        DeckList_txt.Clear()
        TextBox1.Clear()
    End Sub

    Private Sub JToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JToolStripMenuItem.Click
        Dim ofd As New OpenFileDialog()
        TextBox1.Text = "ȉfbLɊ܂܂Ă֎~J[hXg" & vbCrLf

        '͂߂̃t@Cw肷
        '͂߂Ɂut@Cvŕ\镶w肷
        ofd.FileName = "decklist.txt"
        '͂߂ɕ\tH_w肷
        'w肵Ȃi̕j̎́Ã݂fBNg\
        ofd.InitialDirectory = FP
        '[t@C̎]ɕ\Iw肷
        'w肵ȂƂׂẴt@C\
        ofd.Filter = _
            "TEXTt@C(*.text;*.txt)|*.text;*.txt|ׂẴt@C(*.*)|*.*"
        '[t@C̎]ł͂߂
        'uׂẴt@CvIĂ悤ɂ
        ofd.FilterIndex = 2
        '^Cgݒ肷
        ofd.Title = "Jt@CIĂ"
        '_CAO{bNXOɌ݂̃fBNg𕜌悤ɂ
        ofd.RestoreDirectory = True
        '݂Ȃt@C̖Ow肳ꂽƂx\
        'ftHgTrueȂ̂Ŏw肷Kv͂Ȃ
        ofd.CheckFileExists = True
        '݂ȂpXw肳ꂽƂx\
        'ftHgTrueȂ̂Ŏw肷Kv͂Ȃ
        ofd.CheckPathExists = True

        '_CAO\()
        If ofd.ShowDialog() = DialogResult.OK Then

            Dim sr As New System.IO.StreamReader(ofd.FileName, System.Text.Encoding.GetEncoding("shift_jis"))

            While sr.Peek() > -1
                DeckList_txt.Text &= sr.ReadLine() & vbCrLf
            End While

        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        DeckList_txt.Clear()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TextBox1.Clear()
    End Sub
End Class
