如何在iphone本机应用程序中显示Web服务器的目录列表

时间:2009-09-05 14:02:45

标签: iphone

如何从Web服务器上获取iphone本机应用程序上的文件和目录名称?

1 个答案:

答案 0 :(得分:0)

NSData *urlData;
NSString *urlString   = @"mysite.com/myfile";

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval: 10.0]; 

NSURLConnection *connection=[[NSURLConnection alloc] initWithRequest:request delegate:nil]; 
if (connection) { 
    urlData = [ NSURLConnection sendSynchronousRequest: request
}
[connection release];