TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
524
2.4k
600.9k
How to save each ArrayList value?
Oct 4 2016 8:32 PM
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<ViewModel.Tble_Documents, Tble_Documents>(objTble_Documents);
service.AddScanDocuments();
}
}
Reply
Answers (
6
)
Get permutations of array numbers
How can I extract and save the data of social network in DB?