这条线有什么问题 [英] what is wrong with this line

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

问题描述

我正在尝试在我的asp.net页面中使用位图,并且我遇到了一个

问题,因为路径的名称中有一个空格。这是函数的限制

还是我只是忽略了什么?


如果文件名在路径中有空格我会收到错误无效参数。


提前致谢。


Tommy

Dim cPic As String =" d:\\ \\pics\picture.jpg" < ---- works

Dim cPic As String =" d:\ my pictures \ picture.jpg" < ----不起作用

Dim oPic As New Bitmap(cPic)

I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a limitation
of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid parameter".

Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)

推荐答案

我没有''做一个repro,但对于

Bitmap类的构造函数来说这听起来像是个问题。

如何做到这一点来解决它:


Dim oPic As New Bitmap(chr(34)& cPic& chr(34))


Jerry


汤米马丁 < TM ***** @ xspam-tlmartin.com>在消息中写道

新闻:Os ************** @ TK2MSFTNGP09.phx.gbl ...
I didn''t do a repro, but it sounds like a problem with the constructor for
the Bitmap class.
How about just doing this to get around it:

Dim oPic As New Bitmap(chr(34) & cPic & chr(34))

Jerry

"Tommy Martin" <tm*****@xspam-tlmartin.com> wrote in message
news:Os**************@TK2MSFTNGP09.phx.gbl...
我正在尝试使用在我的asp.net页面中的位图,我遇到了一个问题,因为路径的名称中有一个空格。这是函数的
限制还是我只是忽略了什么?

如果文件名在路径中有空格我会收到错误无效的
参数。
提前致谢。

Tommy

Dim cPic As String =" d:\ pics \ picture.jpg" < ---- works
Dim cPic As String =" d:\ my pictures \ picture.jpg" < ----不起作用
Dim oPic As New Bitmap(cPic)
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a limitation of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid parameter".
Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)



嗨Tommy,

据我所知,你不能在asp.net

页面中直接使用位图。


HTML不会让你使用位图,而asp.net页面基本上是HTML,所以当我们去找bg这个错误时,结果可能就是什么都没有。


只是要警告你。


Cor
Hi Tommy,

As far as I know till now, you can not use direct a bitmap in an asp.net
page.

HTML won''t let you use a bitmap and an asp.net page is basicly HTML, so when
we go look for the error the endresult will probably be nothing.

Just something to warn you.

Cor
我试图在我的asp.net页面中使用位图而且我遇到了一个
问题,因为路径的名称中有一个空格。这是函数的
限制还是我只是忽略了什么?

如果文件名在路径中有空格我会收到错误无效
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a limitation of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid



参数" ;.


parameter".


我会尝试一下。


Jerry Ham <叶******************** @ Not.com>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
I will give this a try.

"Jerry Ham" <Ye********************@Not.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
我没有不要做一个repro,但这对于Bitmap类的构造函数来说听起来有点问题。
这样做可以解决它:

Dim oPic As新位图(chr(34)& cPic& chr(34))

Jerry

Tommy Martin < TM ***** @ xspam-tlmartin.com>在消息中写道
新闻:Os ************** @ TK2MSFTNGP09.phx.gbl ...
I didn''t do a repro, but it sounds like a problem with the constructor for
the Bitmap class.
How about just doing this to get around it:

Dim oPic As New Bitmap(chr(34) & cPic & chr(34))

Jerry

"Tommy Martin" <tm*****@xspam-tlmartin.com> wrote in message
news:Os**************@TK2MSFTNGP09.phx.gbl...
我试图在我的位图中使用位图asp.net页面和我遇到了问题,因为路径的名称中有一个空格。这是函数的
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a


限制

还是我只是忽略了什么?

如果文件名在路径中有空格我会得到一个错误无效
of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid


参数。


提前致谢。

Tommy

Dim cPic如String =" d:\ pics \ picture.jpg" < ---- works
Dim cPic As String =" d:\ my pictures \ picture.jpg" < ----不起作用
Dim oPic As New Bitmap(cPic)

Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)




这篇关于这条线有什么问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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