Can u tell me how to read textfile from 15line or from particular line that means i have to ignore first 15 lines of textfile and i should start from 16th line.
I am Trying To get information I stored in the cookie after create it , it's works fine when using IE8 in browsing website but i face problems in Mozilla
I am trying to read and write text file like that, writing
StreamWriter wr = new StreamWriter(Server.MapPath("aa.txt")); wr.Write("aaaa" + System.Environment.NewLine); wr.Write("bbbb" + System.Environment.NewLine); wr.Write("bbbb" + System.Environment.NewLine); wr.Close(); Reading string line11 = ""; using (StreamReader sr = new StreamReader(Server.MapPath("aa.txt"))) { while ((line11 = sr.ReadLine()) != null) { TextBox1.Text += line11 + " "); } }
and want to display
aaaa bbbb bbbb in TextBox1.Text
Writing is not problem , The problem is reading, to display line by line on textbox , we use " " in normal windows form c sharp , but in asp it is not working. also is there anything instead of System.Environment.NewLine when writing. And is there any converter between NORMAL WINDOWS FORM csharp to ASP .NET C SHARP.
I have a process where I ftp a textfile to a webserver and then process the file (load it into a database). The textfile is then deleted. How do I protect the textfile from being viewed/ accessed by a user while it exists? I'm using ASP.Net 2.0
I have a text file that I want to read line by line from into a string variable. On each click of a button I want to read the next line.Solutions I find reading from a textfile do it all at once though (in a while loop), displaying all lines on screen, but I don't want that. I want to fill one variable with the subsequent lines in the textfile, one at a time, everytime by a click on a button.How can I 'loop' through a textfile in this manner, without 'file already in use' errors etc.?
My whole project is about reading data from textfile(the readings is separated by delimiters) and plotting out the graph. But somehow i am meetnig some problems as i think my method is wrong... It's something like this..what should i do?
Private Sub CreateChart() 'Create some dummy data 'Dim random As New Random() 'For pointIndex As Integer = 0 To 9 ' Chart1.Series("Series1").Points.AddY(random.[Next](20, 100)) Dim h, g As String Try Dim lc As New StreamReader("C:Tempdatalogger" & date1.ToString & "int_ana_" + date1.ToString + ".txt") Dim ff As String '= Label5.Text & ":00" 'Dim sr As String = lc.ReadToEnd Dim line6 = lc.ReadLine Do While Not line6 Is Nothing 'loop until end of file If IsNumeric(line6.Chars(0)) Then Dim fields5() = Split(line6, ";") 'Dim fields5() = Split(s.Substring(sr.IndexOf(ff)), ";") h += fields5(0) + vbCr g += fields5(3) + vbCr End If line6 = lc.ReadLine Loop Catch ex As Exception End Try For pointIndex As Double = 0.0 To 2.0 Chart1.Series("Series1").Points.AddXY(h, g) Next 'line display chart Chart1.Series("Series1").ChartType = SeriesChartType.Line 'set the bar width Chart1.Series("Series1")("PointWidth") = "0.1" 'Show Data points labels Chart1.Series("Series1").IsValueShownAsLabel = True 'Set data points label style Chart1.Series("Series1")("BarLabelStyle") = "Center" 'Draw Chart as 3D Cyclinder Chart1.Series("Series1")("DrawingStyle") = "Cylinder" End Sub '****End of Graph
I am making an online form (literal form) that needs to have a certain function: when the user enters a 5-digit number, the form should automatically query the MS SQL DB and retrieve information associated to that number and populate other form elements (text boxes, etc.) accordingly.
So say the # was 12345 and in the DB, the record matching 12345 has name=Fred. So, when I enter 12345 into the form textbox, the name text box should be automatically populated with Fred in it.
If this is not easily achievable, I guess a submit button beside the 5-digit number text box can do.
I am still learning my way around ASP.NET and Visual Studio 2005, however I have ample experience with HTML, CSS, JavaScript, C/C++. The ASP.NET app is to be written in C#.
The above url contain several information .From this url i just want to get bellow information.How to?
Price Earning Ratio : at a glance on Aug 2, 2010 at 11:28:00
I want to know how to get url information into a variable or some storage container in C#.Specific i need above information ,i don't need rest of information. I use the bellow syntax:
WebClient objWebClient = new WebClient();
aRequestHTML = objWebClient.DownloadData("http://www.dsebd.org/latest_PE.php");//http://www.dsebd.org/latest_PE_all2_08.php UTF8Encoding utf8 = new UTF8Encoding(); myString = utf8.GetString(aRequestHTML); HtmlDocument htmlDoc = new HtmlDocument(); htmlDoc.LoadHtml(myString);
After that what to do?i don't guess any thing.Plz show some syntax
foreach (HtmlNode node in doc.DocumentNode.SelectNodes(@"//td"))//td[text()="Price Earning Ratio : at a glance" { if (node.InnerHtml.Contains("Price Earning Ratio")) { //I get the td value } //[text()=Price Earning Ratio : at a glance // do stuff with node //@"//td[text()=Price Earning Ratio : at a glance" }
After add the above syntax i get the bellow out put
<br> <font color="#FFFFFF" size="3" face="Arial"><b>Price Earning Ratio : at a glance <b> </b></b></font><br> <font color="#FFFFFF" size="2" face="Arial"><b> on Aug 2, 2010 at 17:04:00<b></b></b></font> <br>
From this i just want to get the Date part .HOw to ?With out this date i don't need any thing.Each day this date will change,It's dynamical date,so i can not inline this date.From above out put how i get the date .
i have id as TCS ,IBM in my db.When i m giving in drop down text as tcs and values as tcs i need to show in view as tcs (tata consultancy services) like this i want to give some description for the in drop down list box..how can i add this information.
I have a repeater that is used to show information from a set of records. I also need to show a set of related data from another table in another repeater nested within the first repeater. I have been playing around with this but I can not figure out how to handle creating the SQLSource. I tried to pass values from the first repeater into the select command but I get a Parser Error that says that the tag is not well formed.
Code: SelectCommand="SELECT [PLANTID], [SIZE], [PRICE] FROM [PRICE] WHERE ([PLANTID] = <%#DataBinder.Eval(Container.DataItem, "ID")%>)"> Can this be done? is there a better way to go about this?
I want to set culture info for my full application. where're i say datetime.now, it should give datetime based on my cultureinfo i set. how do i do it?
I just started with ASP.net in Visual Studio and I have a problem which I can't find any solution for. I made a master page with a few subpages and one is a very simple shoutbox page. I added a gridview and added some information manually into the database so I could see if it displayed well on the website and it did. So I have a GridView with Name and Message. Beneath that I have a textfield and a button and I'd like to submit the information in the textfield to the database however I don't know how to do it.
I am creating a website and I want to know that user is coming from where, like from google, bing, asp.net, any other site. Is their any way to find out in asp.net ?
Now the property mentioned above returns null even when i use Client/Google in the url. When i reset IIS and do it for first time, it returns value. Otherwise it gives null.
I want to store the log information for website, is there is any inbuild component for that of free source code for that. I want to track the exception and other information that occure in my web site.