File.Move未按预期工作

时间:2015-06-08 11:54:44

标签: c# asp.net-mvc asp.net-web-api

case kTagInnerTableView:
            {
            ORGContainerCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ORGContainerCell"];
            cell.backgroundColor = [UIColor greenColor];
            [cell setCollectionData:self.sampleData];
            [cell setCollectionImage:self.sampleImage];
            cell.textLabel.text = @"Horizontal TableView";
            cell.backgroundColor = [UIColor redColor];
            return cell;                
            }

File.Move(@"/Resources/images/temp/" + xx, @"/Resources/images/event-images/" + newFile); // Try to move 也无法正常工作。如何将其与相对路径一起使用?

你能告诉我如何解决上述问题。提前谢谢。

1 个答案:

答案 0 :(得分:3)

试试这段代码 -

var path = System.Web.Hosting.HostingEnvironment.MapPath("~");//hence WebApi
File.Move(path + "\\Resources\\images\\temp\\" + xx, path + "\\Resources\\images\\event-images\\" + newFile);
相关问题