using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.IO;namespace GetMediaCS
{
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
InitializeComponent();
}
         [WebMethod]
public string[] AvaliableFiles()
{
return Directory.GetFiles("F:\\我的音乐");
}
[WebMethod]
public Byte[] GetFile(string Source)
{
FileStream InputFile;
long FileLength;
try
{
InputFile=File.Open(Source,FileMode.Open,FileAccess.Read);
FileLength=InputFile.Length;
Byte[] DataBuffer=new Byte[FileLength-1];
InputFile.Read(DataBuffer,0,(int)FileLength);
InputFile.Close();
return DataBuffer;
}
catch(Exception Ex)
{
 Ex=new Exception("Unable to Open Specified File");
throw Ex;
}
} }
}
调用GetFile()方法,输入AvaliableFiles()显示的文件名作为GetFile()的参数,但结果是该页无法显示,请高手帮忙解决。