vs 2005 找不到命名空间

来源:百度知道 编辑:UC知道 时间:2024/05/22 16:33:10
代码来源:http://school.cfan.com.cn/pro/html/2006-09-12/1158033554d16500.shtml

代码是:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ofdPicture.ShowDialog();
string strFileName = ofdPicture.FileName;
Picture2HtmlPicture clsHtmlPicture = new Picture2HtmlPicture();
txtTest.Text = clsHtmlPicture.MakeHtmlPicture(strFileName);
}
}
}

你在窗体中有txtTest吗??
估计没有或Name不为txtTest

ofdPicture 是 OpenFileDialog控件名

Picture2HtmlPicture 是前面建的类库,你引用了没有

txtTest 是 TextBox控件名

拖一个PictureBox 控件到你的 FORM1 窗体上,把这个 pictruebox 的 名称改成 ofdPicture