Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Directories

Status
Not open for further replies.

sarad1978

Technical User
Jan 16, 2003
9
US
right now I have a web service that writes out a simple text file from a query string. I need the file to be written out to a different server, I think I need to do it with a vitual directory. I've set that up in IIS, but I can't find any examples of how it's accessed in the coding.

FOLDER_PATH below should be pointing to the virtual directory set up but I'm not sure how to do it. Does anyone know of a FAQ or artical or know the answer.

Thanks,
Sara

public class clientXML
{
public const string member_num = "unknown";
public const string EmpLast = "unknown";
public const string FOLDER_PATH = ("C:\\Orderstatus\\TOCXML\\AutoDialer\\");
public static string LoadXML()
{
string LogFile = FOLDER_PATH + "PostLog\\StreamRec.txt";

string myResponse = "";
myResponse = "here";

string empnum="000";
string EmpLast = Request.QueryString("employee_identifier");
string member_num = Request.QueryString("member_number");

string Emp_PATH = FOLDER_PATH + empnum + "\\";
string emp_PATH = Emp_PATH + member_num +".mn";


FileStream fs = new FileStream(emp_PATH, FileMode.CreateNew, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
fs.Close();
return myResponse;
}


}
}
 
when writing to a different server you need to delegate the web server to the remote sever. This is done through Active Directory. I think you also need a valid account which has access to the remote location.

this is my understanding of how IIS and remote server communication works. (this may not be effecient, or even proper, but it works for my requirements).

1. user logs into local machine.
2. user accesses website.
website uses Windows Impersonation (intranet).
web server now mimics clients credientials
3. web application accesses files on remote server.
web server delegates credentials (which are mimicing the clients credientials) to the remote server.


Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top