Click here to Skip to main content
15,909,242 members

Comments by Sisir Behera (Top 8 by date)

Sisir Behera 4-Jan-16 8:33am View    
Hi All,

Below is the code which i am trying to search all the files from the shared path and also i need to download the files

<pre lang="C#">protected void Button1_Click(object sender, System.EventArgs e)
{

string search = TextBox1.Text;
string[] files = Directory.GetFiles(@"\\sdcntprdeafil01\EAIShare\PDCU\OutboundArchive\StockCR_Archive", "*.*", SearchOption.AllDirectories);
int Flag = 0;
string dir = @"\\sdcntprdeafil01\EAIShare\PDCU\OutboundArchive\StockCR_Archive";
string[] files1;
int numFiles;
files1 = Directory.GetFiles(dir);

numFiles = files.Length;
Response.WriteFile("Files searched : " + numFiles + "<br>");
for (int i = 0; i < numFiles; i++)
{


string file = files[i].ToString();

int file1 = file.IndexOf(search, StringComparison.CurrentCultureIgnoreCase);
if (file1 != -1)
{
Response.Write("<br>" + file);

Flag = 1;


}

}
if (Flag == 0)
{
Response.Write("No Matches Found");
}
}
}</pre>


Please help.
Sisir Behera 2-Jan-16 5:55am View    
File name basically starts with SRCNV series followed by store number.

For Example :
SRCNV868_3284_16122015160100_1.xml

SRCNV868 - File name
3284 - Store Number

So baiscally if you give a search with SRCNV*_Storenumber* , it will give list of all the SRCNV files for that date on the folder present
Sisir Behera 2-Jan-16 4:07am View    
Web application
Sisir Behera 13-May-13 3:10am View    
Hi Sandeep, Currently i am able to read the task scheduler as below:
static private void Usage()
{
ProcessStartInfo psi = new ProcessStartInfo("SCHTASKS", "/QUERY /fo table"); psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = Process.Start(psi);
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived); p.BeginOutputReadLine();
}
static void p_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
string strOutput = "";
strOutput += e.Data ;
}
But here problem seems Status is blank for all the scheduled jobs.So not sure how to display it as success,running,failed or going to run.Believe need to set a timer and as per the scheduled time it will check whether job has ran or not.If it didnt ran or failed it should fire a mail stating the status. This is something i am stucked here.Any idea on this please. Many Thanks, Sisir
Sisir Behera 12-May-13 11:33am View    
Hi,
I do have requirement of two parts :
1.Get all scheduled jobs in windows task scheduler and check the status of them.
2.Send alert email based on the job status,

Any suggestion on this please.

Many Thanks,
Sisir