高手帮我调试一下。

jlu3389 2006-11-29 12:31:45
用visualstudio2005 调试c#出现了问题 帮忙调试
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace flash
{
public partial class Form1 : System.Windows.Forms .Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
 private AxWMPLib .AxWindowsMediaPlayer axWindowsMediaPlayer1;
  private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
protected override void Dipose (bool disposing)
{
if (disposing)
{
if (disposing && (components != null))
{
components.Dispose();

}

}
base.Dispose(disposing);
}


[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void menuItem2_Click(object sender, System.EventArgs e)
{
OpenFileDialog ofDialog = new OpenFileDialog();
ofDialog.AddExtension = true;
ofDialog.CheckFileExists = true;
ofDialog.CheckPathExists = true;
ofDialog .FilterIndex =4;
if(ofDialog .ShowDialog ()==DialogResult.OK )
{
this.axWindowsMediaPlayer1.URL=ofDialog .FileName ;
}

}

private void menuItem3_Click(object sender, System.EventArgs e)
{
Application.Exit();

}
}
}
错误:错误 1 类型“flash.Form1”已经包含“axWindowsMediaPlayer1”的定义 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.cs 16 49 WindowsApplication1
错误 2 类型“flash.Form1”已经包含“components”的定义 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.cs 17 49 WindowsApplication1
...全文
106 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
niaolong 2006-11-30
  • 打赏
  • 举报
回复
我是在做一个论坛的时候.出现了这种情况;
我就自己做了3个小页面检查;
错在哪里呢???
niaolong 2006-11-30
  • 打赏
  • 举报
回复
我有3个页面web1.aspx;web2.aspx;web3.aspx;
web1.aspx中:private void Button1_Click(object sender, System.EventArgs e) {
if(this.TextBox1.Text=="111")
{ Session["UserName"]="admin";
Response.Redirect("WebForm3.aspx");
}
}
web2.aspx:Page_Load中:this.Label1.Text=Session["UserName"].ToString()
可一显示出Session中的东西;
web3.aspx:private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.IsPostBack)
{
this.Label1.Text=Session["UserName"].ToString();
}
}
在web3.aspx怎么就显示不书Session的值admin;
很奇怪.以前从来都没遇到过这样的问题.
jlu3389 2006-11-30
  • 打赏
  • 举报
回复
我刚试过了 还是不行
liujia_0421 2006-11-29
  • 打赏
  • 举报
回复
去掉这两句试试:

private AxWMPLib .AxWindowsMediaPlayer axWindowsMediaPlayer1;
private System.ComponentModel.Container components = null;

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧