473,382 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

path in querystring

Hi!

How can I get a path from a Html (or aspx, it doesn't
matter) to an aspx-site.

I'm sending a path (C:\dir...\file) from the html-page
within a querystring:
page.aspx?path=C:\dir...\file
in the page_load i recieve the path:
String path = Request.QueryString["path"];
....but I can't use it in for example:
File.Exist(path);
The debuggger shows an "@" in front of the path-string:
@"C:\dir...\file"

/Miro
Nov 17 '05 #1
2 1986

"Miro" <mi*************@va-utveckling.se> wrote in message
news:2b*****************************@phx.gbl...
Hi!

How can I get a path from a Html (or aspx, it doesn't
matter) to an aspx-site.

I'm sending a path (C:\dir...\file) from the html-page
within a querystring:
page.aspx?path=C:\dir...\file


in the page_load i recieve the path:
String path = Request.QueryString["path"];


...but I can't use it in for example:
File.Exist(path);


The debuggger shows an "@" in front of the path-string:
@"C:\dir...\file"

/Miro


Did you try it? The "@" is added to the output by the debugger, because the
string
contains a backslash. The "real" string doesn't contain that "@".
Try displaying the string in a textbox (or whatever, as long as it is not
the debugger)
then you will see the correct text.

Hans Kesting
Nov 17 '05 #2
Hello Hans!

The File.Exist method returns false though the path is
correct. But I guess it has something to do with spaces
in path because the path contained the folder \Documents
and settings\. When I tried a simple path C:\file it
returned true. Anyway, I found a different solution for
this case, not involving querystrings. Thanks anyway!

/Miro
-----Original Message-----

"Miro" <mi*************@va-utveckling.se> wrote in messagenews:2b*****************************@phx.gbl...
Hi!

How can I get a path from a Html (or aspx, it doesn't
matter) to an aspx-site.

I'm sending a path (C:\dir...\file) from the html-page
within a querystring:
> page.aspx?path=C:\dir...\file
in the page_load i recieve the path:
> String path = Request.QueryString["path"];


...but I can't use it in for example:
> File.Exist(path);


The debuggger shows an "@" in front of the path-string:
> @"C:\dir...\file"

/Miro


Did you try it? The "@" is added to the output by the

debugger, because thestring
contains a backslash. The "real" string doesn't contain that "@".Try displaying the string in a textbox (or whatever, as long as it is notthe debugger)
then you will see the correct text.

Hans Kesting
.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
2
by: Jester | last post by:
I'm fairly new to asp.net. What is the syntax for the string to pull and image path from a DB and display that image based on the given path? I am trying to stay away from actually storing images...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
3
by: Rob R. Ainscough | last post by:
How can I extract the path argument info in ASP.NET (using VB.NET)? Examples my Main.aspx form is linked using "Main.aspx?CallFrom=MyApp" I want to be able to extract the name/value pair...
11
by: cdkorzen | last post by:
I'm sorry if this is a rehash, but all I see is the same info. Here's my debacle: I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python, Perl, Cmd files... works fine. ASP can't...
1
by: Billy | last post by:
Hi All, I'm attempting to use the MapNetworkDrive <snippedbelow from entire code below with very poor performance results. Basically, I have very small 73kb text files that are rewritten daily...
3
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record...
4
Claus Mygind
by: Claus Mygind | last post by:
I am working on a small page I want to use for myself at home. I am trying to load the name of a file along with it's path into and Ajax call but all I get is the file name. Here is the 4 attempts I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.