Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42225

FileSystem.ReadAllText with more users?

$
0
0
Hello Guys.

First. Sorry for my bad englisch ;)

Ok. Lets begin.

i creat little program with this function

Code:

Public Function ReadLine(ByVal filename As String, _
      ByVal line As Integer) As String

        Try
            Dim lines As String() = My.Computer.FileSystem.ReadAllText( _
              filename, System.Text.Encoding.Default).Split(vbCrLf)


            If line > 0 Then
                ' n-te Zeile vom Anfang der Textdatei
                Return lines(line - 1)
            ElseIf line < 0 Then
                ' n-te Zeile beginnend am Ende der Textdatei
                Return lines(lines.Length + line - 1)
            Else
                ' ungültige Zeilennummer
                Return ""
            End If
        Catch ex As Exception
            Return ""


        End Try

    End Function

^


Problem : if i use this code for lan for one shared folder a massage comes *this one i used by a other process* but still only with Windows XP. Vista and Win7 havnt Problems.

And now the Questions. u know a code that unlogg the file after functions end?

very very sorry guys for this bad englisch. i hope u know what i mean xD !

i wish u marry christmas

Viewing all articles
Browse latest Browse all 42225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>