<%@ WebService Language="vb" Class="MyWebService" %>
Imports System.IO
Imports System.Web.Services
Public Class MyWebService
<WebMethod> Public Function GetTextFile(FileName As String) As String
Dim s As String
Dim buff As String = ""
' テキストファイルの内容を読み出す。
Dim sr As StreamReader = File.OpenText(FileName)
While True
s = sr.ReadLine()
If s is Nothing Then
Exit While
Else
buff = buff & s
End If
End While
sr.Close()
' テキストファイルの内容を返す。
Return buff
End Function
End Class
|