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
Mohammed Sithiq
NA
2
603
File Fetch from given Path
Aug 19 2017 4:58 AM
I done code with C#
I put .txt file in folder path and that file will modify and another txt file generated successfully I done in coding.
But how to automate or how to implement this code to user or deploy this application without any click event..
Monitoring File Path if File the exist the create new file.how to do?
i was doing run my application and creating new file.
with any Click event or run application that process need to automate.
and how to create .exe and deploy this application to user.
My Code
-------------------
try
{
using (StreamReader sr = new StreamReader("D:/Rahman/data.txt"))
{
String line = "";
while ((line = sr.ReadLine()) != null)
{
content = line;
string[] subText = new string[5];
subText[0] = content.Substring(0, 5).Trim();
subText[1] = content.Substring(8, 5).Trim();
subText[2] = content.Substring(13, 8).Trim();
subText[3] = content.Substring(21, 4).Trim();
subText[4] = content.Substring(26);//IP Address
content = subText[2] + "," + subText[0] + "," + subText[3] + ",,P10,";
//TextWriter tr = new StreamWriter("F:/Sithiq/ReadText/date1.txt");
File.AppendAllText("D:/Rahman/ModifiedData.txt", content + Environment.NewLine);
}
}
}
catch (Exception ex)
{
// MessageBox.Show(ex.ToString());
}
Reply
Answers (
2
)
c# .net static method
Deleting list using unitofwork