Click here to Skip to main content
16,016,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

I need your help. I have a webform created in asp.net, with starting virtual directory on IIS:

/myWeb/Default.aspx

and can be accessed in browser here: http://myserver/myWeb/Default.aspx

Here I can upload files to a virtual directory:

/myWeb/uploads/

This works fine.

My question is, that how can I access the file list from winForm (C#.net) and show the results in ListBox (or ListView or dataGridView. I don't know which one is perfect for this). I think my weapon is HostingEnvironment.MapPath in C#.NET.

The WinForm is deployed with ClickOnce, so it has a virtual directory in IIS of course. But totally another than webform.

What if I enable directory browsing on the 'uploads' directory? should I have to? I don't want to use FTP connection to get the file list.

thanks for your help.

Attila
Posted
Comments
Maciej Los 17-Aug-15 5:39am    
Does server and machine is placed on the same LAN?
DoomMaker79 17-Aug-15 6:33am    
Yes they are. But file sharing is not working. I managed to find a solution with HttpWebRequest. It is not bad, but if I can have a solution with MapPath, that would be awesome.
ZurdoDev 17-Aug-15 8:38am    
Your winform will need permissions to see c:\inetpub\wwwroot\... wherever your files are.
Maciej Los 17-Aug-15 17:28pm    
My virtual 5!

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900