加载文件 [英] Load file

查看:78
本文介绍了加载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从下拉列表中加载文件,但是我收到错误说

需要虚拟路径。选择的示例值将是

" ../ 4900 / myfile.doc"。任何想法 - 我的代码是。


Dim sumfin As String = DropDownList1.SelectedValue.ToString

Dim pos As Integer = sumfin.Length

Dim bString As String = sumfin.Substring(3,pos - 3)

Dim cString As String =" http:// localhost /" &安培; bString

Server.Transfer(cString)

I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)

推荐答案

虚拟路径为:


Dim cString As String =" /" &安培; bString


试试吧。


或者你可以去:

Response.Redirect(cString)


PS


这是'某事'而不是''sumfin'';)

" Niggy" <镍*** @ discussions.microsoft.com>在留言中写道

news:73 ********************************** @ microsof t.com ...
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It''s ''something'' and not ''sumfin'' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
我正在尝试从下拉列表中加载文件,但是我收到错误

需要虚拟路径。选择的示例值将是
../ 4900 / myfile.doc。任何想法 - 我的代码是。

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring( 3,pos - 3)
Dim cString As String =" http:// localhost /" &安培; bString
Server.Transfer(cString)
I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)



尝试使用Server.MapPath(bString)


Clint Hill

H3O软件
http://www.h3osoftware。 com


Niggy写道:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
我正在尝试从下拉列表中加载文件,但是我收到错误说
a虚拟路径是必需的。选择的示例值将是
../ 4900 / myfile.doc。任何想法 - 我的代码是。

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring( 3,pos - 3)
Dim cString As String =" http:// localhost /" &安培; bString
Server.Transfer(cString)
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)



尝试使用Server.MapPath(bString)


Clint Hill

H3O软件
http://www.h3osoftware。 com


Niggy写道:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
我正在尝试从下拉列表中加载文件,但是我收到错误说
a虚拟路径是必需的。选择的示例值将是
../ 4900 / myfile.doc。任何想法 - 我的代码是。

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring( 3,pos - 3)
Dim cString As String =" http:// localhost /" &安培; bString
Server.Transfer(cString)
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)



这篇关于加载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆