Click here to Skip to main content
15,890,579 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Call External Javascript File in aspx file Pin
N a v a n e e t h20-Jan-09 17:30
N a v a n e e t h20-Jan-09 17:30 
AnswerRe: Call External Javascript File in aspx file Pin
Abhijit Jana20-Jan-09 17:32
professionalAbhijit Jana20-Jan-09 17:32 
QuestionCrystal Report 11 in VB ASP .NET Pin
saberbladez20-Jan-09 15:26
saberbladez20-Jan-09 15:26 
QuestionUser Control Embedded Classes Pin
MacSpudster20-Jan-09 12:06
professionalMacSpudster20-Jan-09 12:06 
QuestionPass Filepath between webforms Pin
Terick20-Jan-09 11:38
Terick20-Jan-09 11:38 
AnswerRe: Pass Filepath between webforms Pin
Christian Graus20-Jan-09 13:38
protectorChristian Graus20-Jan-09 13:38 
GeneralRe: Pass Filepath between webforms Pin
Terick21-Jan-09 3:33
Terick21-Jan-09 3:33 
GeneralRe: Pass Filepath between webforms Pin
Terick21-Jan-09 3:47
Terick21-Jan-09 3:47 
This is what I have so far. Perhaps this can help you see what I am doing/intending to do:

Form1.aspx.cs

public void button_Click(object sender, EventArgs e)
{
string dt= string.Format("Text{0:yyyy-MM-dd_hh-mm-ss}.txt", DateTime.Now);
StreamWriter sw;
sw= File.CreateText(@"C:\Documents and Settings\user\Desktop\Request\" +dt);
sw. WriteLine("This is the first line");
sw.Close();

string filepath = @"C:\Documents and Settings\user\Desktop\Request\" +dt;
FileInfo file = new FileInfo(filepath);
string filename= Path.GetFileName(filepath);
}

Form2.aspx.cs

public void Timer1_Tick(object sender, EventArgs e)
{
FileStream file = new FileStream (filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
StreamReader sr = new StreamReader(file);
string s= null;
while ((s= sr.ReadLine()) != null)
{
if (s.IndexOf("Current Statue: ") != -1)
{
lblStatus.Text = s;
break;
}
}
sr.Close();
}


Because the text file is a log file, I need to continuously monitor it as it is being updated. Hence, I've placed it inside an UpdateControl and set it inside the timer so that every time the timer goes off, the file is looked into.

The error I'm encountering is that the "filename" is not being recognized in the second form.

Thanks
QuestionCustom HttpHandler not working. [modified] Pin
Tristan Rhodes20-Jan-09 5:03
Tristan Rhodes20-Jan-09 5:03 
AnswerRe: Custom HttpHandler not working. Pin
Abhishek Sur20-Jan-09 10:34
professionalAbhishek Sur20-Jan-09 10:34 
AnswerRe: Custom HttpHandler not working. Pin
N a v a n e e t h20-Jan-09 18:43
N a v a n e e t h20-Jan-09 18:43 
Question[newbie] public static property error - stack overflow Pin
jon-8020-Jan-09 1:30
professionaljon-8020-Jan-09 1:30 
AnswerRe: [newbie] public static property error - stack overflow Pin
Christian Graus20-Jan-09 1:53
protectorChristian Graus20-Jan-09 1:53 
QuestionHow to Play vedio in Asp.net?and how to find time of play for the video? Pin
Member 472018420-Jan-09 1:11
Member 472018420-Jan-09 1:11 
AnswerRe: How to Play vedio in Asp.net?and how to find time of play for the video? Pin
Christian Graus20-Jan-09 1:55
protectorChristian Graus20-Jan-09 1:55 
QuestionInternal .Net Framework Data Provider error 12. Pin
krishnaveer20-Jan-09 0:16
krishnaveer20-Jan-09 0:16 
AnswerRe: Internal .Net Framework Data Provider error 12. Pin
Vimalsoft(Pty) Ltd8-Mar-10 0:34
professionalVimalsoft(Pty) Ltd8-Mar-10 0:34 
Questionnested iframes Pin
vjvjvjvj19-Jan-09 23:55
vjvjvjvj19-Jan-09 23:55 
QuestionHow To pass page as parameter Pin
ais0719-Jan-09 23:23
ais0719-Jan-09 23:23 
AnswerRe: How To pass page as parameter Pin
Aman Bhullar19-Jan-09 23:37
Aman Bhullar19-Jan-09 23:37 
GeneralRe: How To pass page as parameter Pin
ais0719-Jan-09 23:42
ais0719-Jan-09 23:42 
GeneralRe: How To pass page as parameter Pin
Aman Bhullar20-Jan-09 2:07
Aman Bhullar20-Jan-09 2:07 
GeneralRe: How To pass page as parameter Pin
Paddy Boyd19-Jan-09 23:53
Paddy Boyd19-Jan-09 23:53 
GeneralRe: How To pass page as parameter Pin
Aman Bhullar20-Jan-09 5:20
Aman Bhullar20-Jan-09 5:20 
AnswerRe: How To pass page as parameter Pin
Paddy Boyd19-Jan-09 23:54
Paddy Boyd19-Jan-09 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.