Using the following to access files in a folder on a server, I can't resolve the "Server" part. It wants to change to SQLServer, and it doesn't work. The code works fine in a normal codebehind page, but trying to use it as a WebMethod won't work.
Any ideas?
[WebMethod()]
public static ArrayList populateDropDownList(string UserID, string MediaFilesFolder)
{
ArrayList ual = new ArrayList(); // URL Array List
string[] Files;
Files = Directory.GetFiles(Server.MapPath(MediaFilesFolder));
var i = 0;
foreach (string fls in Files)
{
string FileName = Path.GetFileName(fls);
string extension = System.IO.Path.GetExtension(FileName);
FileName = FileName.Substring(0, FileName.Length - extension.Length);
if (!(ual.Contains(FileName))) // Eliminate duplicates
{
...
Go to the complete details ...