问题描述
请帮帮我。我想从URL填充datagridview单元格中的图片。
URL字符太长,超过500.发生以下异常。如何解决这个问题。
// URL是http://localhost/InnovatorServer11/vault/vaultserver.aspx?dbName = Aras11_Training& fileId = 6DF87A1831EF45989C513B1B753E9424& fileName = THS.SLDPRT& vaultId = 67BBB9204FE84A8981ED8313049BA06C&令牌= EBjexppd5HspePpmggvn0PHDi0MhfKNIhTRRyl5XXEA5KxKGKF2KMzU7qfJ76s1Fg8vL2sbi9CZaYOTwy8aw4BtqrhOPgE8QFKW_mYkgIRn4RYzoHqj7VxzR0GFd4VNY0ZnkujL9wfjV2z8JBaSBuiTFE_Y_MjttAczf-pPiGi2Tgu6-ZnuS35ezHukMuLjx4QLbqsBzI73u7cbLSQUyUIBmW5KBSYh1HcKjwdjy9X8J1uZa69HrV0_7wkatvNewGsr7HQ3Nnk5zYWOd42Lf9zs1DBL-w8B-E2BgY7D6o6dzfzqHFRNF0R2Gm59tALb1kxKXD4HB97HYEfmj9ZbVF1TCKO9Pd4XQyq8sWxLun5_87eFSpe1LzvADQp7NJCbu0\"
指定的路径,文件名,或者两者都太长。完全限定的文件名必须少于260个字符,目录名必须少于248个字符。
Please help me. I would to like fill pictures in the datagridview cells from URL.
URL characters are too long,over 500. The following exception occurs. How to solve that.
// URL is "http://localhost/InnovatorServer11/vault/vaultserver.aspx?dbName=Aras11_Training&fileId=6DF87A1831EF45989C513B1B753E9424&fileName=THS.SLDPRT&vaultId=67BBB9204FE84A8981ED8313049BA06C&token=EBjexppd5HspePpmggvn0PHDi0MhfKNIhTRRyl5XXEA5KxKGKF2KMzU7qfJ76s1Fg8vL2sbi9CZaYOTwy8aw4BtqrhOPgE8QFKW_mYkgIRn4RYzoHqj7VxzR0GFd4VNY0ZnkujL9wfjV2z8JBaSBuiTFE_Y_MjttAczf-pPiGi2Tgu6-ZnuS35ezHukMuLjx4QLbqsBzI73u7cbLSQUyUIBmW5KBSYh1HcKjwdjy9X8J1uZa69HrV0_7wkatvNewGsr7HQ3Nnk5zYWOd42Lf9zs1DBL-w8B-E2BgY7D6o6dzfzqHFRNF0R2Gm59tALb1kxKXD4HB97HYEfmj9ZbVF1TCKO9Pd4XQyq8sWxLun5_87eFSpe1LzvADQp7NJCbu0"
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
dgvsearch.DataSource = dt;
// add thubnails to datagridview
for (int i = 0; i <= dgvsearch.RowCount; i++)
{
int _imgsize = 50;
Image img;
try
{
//img = image.fromfile(dt.rows[i]["thumbnail"].tostring());
img = RetrieveArasData.ResizeImage(dt.Rows[i]["thumbnail"].ToString(), _imgsize, _imgsize, false);
dgvsearch.Rows[i].Cells["thumbnail"].Value = img;
}
catch (Exception)
{
//throw;
}
}
推荐答案
这篇关于完全限定的文件名必须少于260个字符,目录名必须少于248个字符。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!