Hello Everyone,
I am trying to each save filepath and filename from Arralist.
In the 'Images' folder have 3 .jpg file. Like that, 'E:\File\Images\A_001.jpg' , E:\File\Images\A_002.jpg ect. I want to save each filepath and
filename (A_001), here 'A' is parrentName and childName is 001,002 ect. childName want to save under the parrentName. How to save each filepath and filename?
- string[] jpgFilePath = Directory.GetFiles(@"E:\File\Images", "*.jpg").ToArray();
- string[] jpgFilesNames = Directory.GetFiles(@"E:\File\Images", "*.jpg")
- .Select(path => Path.GetFileName(path))
- .ToArray();
- objTble_Documents.CreatedDate = Convert.ToDateTime(DateTime.Now);
- objTble_Documents.IsActive = true;
- objTble_Documents.CreatedBy = 1;
- objTble_Documents.UserId = 1;
- foreach (var item in jpgFilePath)
- {
- foreach (var item1 in jpgFilesNames)
- {
- string parrentName = item1.Split('_')[0];
- string childName = item1.Split('_')[1];
- objTble_Documents.FilePath = item;
- objTble_Documents.Parent_File_Name = parrentName;
- objTble_Documents.Child_File_Name = childName;
- service.ObjDocuments = Mapper.Map
(objTble_Documents); - service.AddScanDocuments();
- }
- }

Manas MohapatraPosted Oct 5, 2016, 3:27 AM
Bikesh SrivastavaPosted Oct 5, 2016, 9:28 AM
Abhilash J APosted Oct 5, 2016, 12:54 AM
Delpin Susai RajPosted Oct 4, 2016, 10:48 PM
Delpin Susai RajPosted Oct 4, 2016, 10:48 PM
Bikesh SrivastavaPosted Oct 4, 2016, 10:46 PM