Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8721845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:17:13+00:00 2026-06-13T07:17:13+00:00

I’m trying to run this; using System; using System.Collections.Generic; using System.Linq; using System.Web; using

  • 0

I’m trying to run this;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.IO;

public partial class _Default : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
 {
        DosyadanOku("c:\\sucdefteri.txt");

        Console.ReadLine();
    }

    public void DosyadanOku(string sucdefteri)
    {
        StreamReader dosyaOku = new StreamReader(@"C:\\sucdefteri.txt");

            string metin;
            metin = dosyaOku.ReadLine();

            string kesme = "\t";
            char[] b = kesme.ToCharArray();
            string[] satirlar = metin.Split(b);
            Page.ClientScript.RegisterArrayDeclaration("Skills", satirlar[2]);


        dosyaOku.Close();

}
}

at my server side of ASP.net page. This simply gets a line from sucdefteri.txt, then cuts a part of it and passes it to client side of page with

Page.ClientScript.RegisterArrayDeclaration(“Skills”, satirlar[2]);. I mean it should, but it can’t. If I try this file reading/cutting code as a console application, it’s working fine, getting the part from the line and print it to console. But it’s not working with this. And also if I add a code like this;

satirlar[2] ="'izmit'";

and then send it to client, it’s working. So I think something is wrong with the file reading.

Thank you for your helps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:17:14+00:00Added an answer on June 13, 2026 at 7:17 am

    use Server.MapPath(" ")
    like this

    StreamWriter _testData = new StreamWriter(Server.MapPath("~/data.txt"), true);
        _testData.WriteLine(TextBox1.Text); // Write the file.
        _testData.Flush();
        _testData.Close(); // Close the instance of StreamWriter.
        _testData.Dispose(); // Dispose from memory.       
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.