|
Hi friends,
I am using the following code to read a table and store the table as a text file it works fine but i want to store the text file in a specific location according to need,any function to do it?By default it is storing in desktop how to change it?
StringBuilder str = new StringBuilder();
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
for (int j = 0; j <= ds.Tables[0].Columns.Count - 1; j++)
{
str.Append(ds.Tables[0].Rows[i][j].ToString());
}
str.Append(Environment.NewLine);
}
Response.Clear();
Response.AddHeader("content-disposition",
"attachment;filename=FileName.m3u");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.txt";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
Response.Write(str.ToString());
Response.End();
|
|
|
|
|
B87 wrote: By default it is storing in desktop how to change it?
That depends on user and browser. Once the file is sent to response, ASP.NET don't have any control over it.
|
|
|
|
|
how to play video in asp.net 2.0 page, video i stored in one folder in project. i want to play this video on the page. could you help me out.
thank you sir.
yogesh
|
|
|
|
|
Here find a good link for you
Check this[^]
Cheers!!
Brij
|
|
|
|
|
ASP.NET has nothing to do with playing video. It is done by the browser. You only have to embed a HTML object tag and browser will decide how to play it.
Silverlight is another option.
|
|
|
|
|
Hi everybody,
can anybody help me in finding the no of visitors visited my website and dispaly the same in the home page of the same
Thanks in advance
|
|
|
|
|
I have explained it here[^]
|
|
|
|
|
Hello,
Thz is only for active visitors i think,but i need count of the total visitors who all r visited the site.Can you help out in that.
Thank you
|
|
|
|
|
Just don't decrease the count in session_end. Rest everything will be same. If you need to effectively track all these details, subscribe to google analytics. It has got sevaral options which gives you statistics about your website. After all it is free too.
|
|
|
|
|
Visit
http://www.hit-counter-download.com/
For details
|
|
|
|
|
Hi,
I want to make my website configurable so I want to include some settings somewhere (maybe in web.Config file), when I was reading about this topic I found that Windows Form Apps can have "Application Settings" file in which you can visually create and remove user scope and application scope settings, which seems to be an easier way to make a project configurable, but I noticed that I can't store whatever objects I want, for example I can't store List<mycustomclass> object, and I don't know if this type of settings is applicable to web applications.
In short, I want to know the best way to make a Web Project Configurable in terms of:
1. It is easy (and not time consuming) to add/remove settings.
2. It can store custom objects for example: MyCustomClass.
Any Ideas?
Thanks alot
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
Mohammad A Gdeisat wrote: It is easy (and not time consuming) to add/remove settings.
Put it in custom configuration files. Write classes for reading and writing to these files. For primitive values, you should be able to open this config file manually and edit the required settings.
Mohammad A Gdeisat wrote: It can store custom objects for example: MyCustomClass.
This also can be kept on XML files. You need to serialize the custom type's object and encode to Base64 . Problem with this approach is you need to create some user interface to manage this and can't be edited by opening the file directly.
Mohammad A Gdeisat wrote: I can't store List object, and I don't know if this type of settings is applicable to web applications.
As I said, it can be serialized and stored. But I will not suggest keeping custom types in configuration files as serialized. Because you can't manage it easily. Recommended approach is to keep values which can be used to create the custom type. Read this values and create your type and if it is used frequently and not user specific, cache it.
To explain my point, assume you have to keep details of people who are administrators of the site. You can keep your configuration entries like
<administrators>
<administrator>
<name>name1</name>
<role>somerole</role>
</administrator>
<administrator>
<name>name2</name>
<role>somerole</role>
</administrator>
</administrators> You need to create a type for administrator with necessary properties. Read these details from this configuration and fill your custom types. Cache it in static variables or ASP.NET cache object for future use.
XML serialization also works well.
Hope this helps
|
|
|
|
|
Yes, this definitely gives a better view
Thanks for your time
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
If you want to use global setting for website then Opt for Application Variables.
|
|
|
|
|
hi...
i'm doing my engineering final year ... i need to do a project in my final semester... can someone help me out with some good topics... would be grateful for your help....
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
i'm soory for having done that...
|
|
|
|
|
Why don't you look into Google
Cheers!!
Brij
|
|
|
|
|
i searched.... but aint able to grasp much...
|
|
|
|
|
Why is it that so many people think the best way to find a topic, is to ask a forum ? how do we know what you're capable of ? I assume whatever we suggst, in a week you'll ask us to write it for you.
Think about what your skillset is, think of the coolest thing you think you can achieve, and do it. A reasonable idea, well executed, will surely get more marks than a great idea, poorly executed.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
indeed true boss... but i'm weak in coding... but good in designing... any suggestions???
|
|
|
|
|
I have made an App_Themes and put on it 2 folders ... My question is how can I use these themes in my web in order to apply the selected themes by the user to the all pages
when the user select the theme such as blue how can I apply this theme "blue" in all pages
thaanks
|
|
|
|
|
Have a look[^]
You can set it , in your master pages. If you want to change runtime you need to use HttpHandler. Search Google for that
cheers,
Abhijit
|
|
|
|
|
How do we reset the sessionid,when we click on file --> new window or CNTRL + N
existing sessionid is being used.
Is it possible to issue a new sessionid to the browser in that case ?
i tried resetting the sessionid cookie but nothing happened
Session.Abandon();
Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
Even after resetting consecutive postbacks still have the other windows sessionid.
|
|
|
|
|
This is getting asked constantly. I don't believe there is a solution.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|