15,891,136 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 13801408 (Top 3 by date)
Member 13801408
26-Jul-18 13:28pm
View
No, in local machine.
This is internal app
Member 13801408
31-May-18 16:30pm
View
Hi Richard,
Thanks for the help.
When I tried running this, I'm getting correct output what I was expecting. But the foreach loop is iterating synchronously. But I want It to run in Asynchronously. So that I can improve the performance.
Thanks, in advance.
This is the unzip code:
protected internal static void data(string filepath)
{
try
{
//Extract Sub-Directory from the filepath
Create_Sub_DirectoryUnzip = filepath .Substring(MainForm.sourcepath.Length+1);
Create_Sub_DirectoryUnzip = Path.GetDirectoryName(Create_Sub_DirectoryUnzip);
//Log Filename without extension
Log_Filename = Path.GetFileNameWithoutExtension(filepath);
Log_Filename = Log_Filename.Remove(Log_Filename.Length - 4);
//Extract path to unzip the file
Extract_Path = destinationpath + "\\" + Create_Sub_DirectoryUnzip + "Unzip" ;
Unzipfilepath = Extract_Path + "\\" + Log_Filename + ".log";
if (!File.Exists(Unzipfilepath))
{
if (!Directory.Exists(Extract_Path))
{
Directory.CreateDirectory(Extract_Path);
}
ZipFile.ExtractToDirectory(filepath, Extract_Path);
}
if (new FileInfo(Unzipfilepath).Length > 0)
{
var contentvalid = File.ReadLines(Unzipfilepath).Skip(0).Take(1).First();
var content = File.ReadLines(Unzipfilepath).Skip(1).Take(1).First();
string valid = contentvalid.Split('|').Skip(0).Take(1).First();
if (valid == "Timestamp")
{
string RecordType = content.Split('|').Skip(7).Take(1).First();
if (RecordType == "10")
{
SQL_Bulk_Copy oHelper = new SQL_Bulk_Copy();
logFilePath = Unzipfilepath;
oHelper.BulkInsertIntoDatabase(logFilePath);
}
else
{
File.Delete(Unzipfilepath);
}
}
else
{
File.Delete(Unzipfilepath);
}
}
else
{
File.Delete(Unzipfilepath);
}
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
Member 13801408
15-May-18 14:34pm
View
Thank you for your response.
I tried this method.(it will work only when Namespace is ns2) My question is what if the namespace is ns1?
The data in the xml string contain different namespaces for different messages
But we don't know what will the be namespace in that string, I may get either
<ns2:faclocnr>2782
or
<ns1:faclocnr>2782