网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
07月07日漏签0天
c吧 关注:133,438贴子:393,972
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 5回复贴,共1页
<<返回c吧
>0< 加载中...

无法访问 受保护级别限制 求解答

  • 只看楼主
  • 收藏

  • 回复
  • 丿樹下de星光彡
  • 托儿所
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using KTVmusic.KTV_class;
namespace KTVmusic
{
public partial class frmNumber : Form
{
public frmNumber()
{
InitializeComponent();
}
public frmNumber(int inCount)
{
InitializeComponent();
intFalg = inCount;
}
public int intFalg = 0;//控件点歌条件
private void frmNumber_Load(object sender, EventArgs e)
{
if (intFalg == 1)//数字
{
this.Text = "数字点歌";
}
if (intFalg == 2)//拼音
{
this.Text = "拼音点歌";
}
if (intFalg == 3)//明星
{
this.Text = "明星点歌";
}
if (intFalg == 4)//歌名
{
this.Text = "歌名点歌";
}
txtName.Focus();
}
//确定调用查询结果
tbMusicnfoMenthod tbMusice = new tbMusicnfoMenthod();//实例方法类
private void bntOK_Click(object sender, EventArgs e)
{
if (txtName.Text == "")
{
MessageBox.Show("输入正确的查询条件!");
txtName.Focus();
return;
}
frmDaiGe daige = (frmDaiGe)this.Owner;//实例窗体对象
if (intFalg == 1)//数字
{
//调用方法查找结果,填冲控件
if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 1) != 0)
{
intFalg = 0;
this.Close();
}
else
{
intFalg = 1;
MessageBox.Show("没有查到结果,请输入其它条件");
txtName.Text = "";
txtName.Focus();
}
}
if (intFalg == 2)//拼音
{
if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 2) != 0)
{
intFalg = 0;
this.Close();
}
else
{
intFalg = 2;
MessageBox.Show("没有结查,请输入其它条件");
txtName.Text = "";
txtName.Focus();
}
}
if (intFalg == 3)//明星
{
if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 3) != 0)
{
intFalg = 0;
this.Close();
}
else
{
intFalg = 3;
MessageBox.Show("没有结查,请输入其它条件");
txtName.Text = "";
txtName.Focus();
}
}
if (intFalg == 4)//歌名
{
if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 4) != 0)
{
intFalg = 0;
this.Close();
}
else
{
intFalg = 4;
MessageBox.Show("没有结查,请输入其它条件\n 可以断续输入查询条件或退出", "查询提示");
txtName.Text = "";
txtName.Focus();
}
}
}
//文本框数字
private void txtName_KeyPress(object sender, KeyPressEventArgs e)
{
if (intFalg == 1)//数字
{
if (!char.IsDigit(e.KeyChar) && e.KeyChar != 8)
{
MessageBox.Show("数字点歌,请输入数字!", "数字点歌");
e.Handled = true;
}
}
if (intFalg == 2)//拼音
{
if (!char.IsLetter(e.KeyChar) && e.KeyChar != 8)
{
MessageBox.Show("拼音点歌,请输入拼音!", "拼音点歌");
e.Handled = true;
}
}
}
//退出
private void bntEsce_Click(object sender, EventArgs e)
{
DialogResult dra = MessageBox.Show("是否退出" + this.Text, "信息提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (dra == DialogResult.Yes)
{
this.Close();
}
}
}
}
顺带一提 这个是c#语言 C#吧里听说很不友好 只好求助于次
网上说把prvite改public没有用


  • 丿樹下de星光彡
  • 托儿所
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
只有四个同样的错误描述为:错误 4 “KTVmusic.frmDaiGe.lvPlay”不可访问,因为它受保护级别限制 C:\Documents and Settings\Administrator\桌面\软件开发项目\KTVmusic\KTVmusic\frmNumber.cs 111 43 KTVmusic


2025-07-07 05:08:05
广告
  • 丿樹下de星光彡
  • 托儿所
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using KTVmusic.KTV_class;
namespace KTVmusic
{
public partial class frmDaiGe : Form
{
public frmDaiGe()
{
InitializeComponent();
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
//数字点歌
private void bntNumber_Click(object sender, EventArgs e)
{
frmNumber frm1 = new frmNumber(1);
frm1.Owner = this;
frm1.ShowDialog();
}
//拼音点歌
private void bntPing_Click(object sender, EventArgs e)
{
frmNumber frm2 = new frmNumber(2);
frm2.Owner = this;
frm2.ShowDialog();
}
//明星点歌
private void bntAutor_Click(object sender, EventArgs e)
{
frmNumber frm3 = new frmNumber(3);
frm3.Owner = this;
frm3.ShowDialog();
}
//歌名点歌
private void bntName_Click(object sender, EventArgs e)
{
frmNumber frm4 = new frmNumber(4);
frm4.Owner = this;
frm4.ShowDialog();
}
private void bntEsce_Click(object sender, EventArgs e)
{
DialogResult diaol = MessageBox.Show("是否要退出系统!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (diaol == DialogResult.Yes)
{
Application.Exit();
}
}
tbMusicnfoMenthod tbMend = new tbMusicnfoMenthod();
private void bntSelect_Click(object sender, EventArgs e)
{
if (stringName != null)
{
stringName = tbMend.tbFillName(stringName);
MessageBox.Show("选择歌曲<<" + strigName2 + ">>完成,单击《播放》按钮,播放歌曲!", "提示");
}
else
{
MessageBox.Show("请选择要播放的歌曲!", "提示");
}
}
public void bntPlay_Click(object sender, EventArgs e)
{
if (stringName != null)
{
frmPlay frm = new frmPlay(stringName);
frm.Owner = this;
frm.ShowDialog();
stringName = null;
lvPlay.SelectedItems[0].Selected = false;
}
else
{
MessageBox.Show("请选择要播放的歌曲!", "提示");
}
}
string stringName = null;
string strigName2 = null;
public void lvPlay_Click(object sender, EventArgs e)
{
stringName = lvPlay.SelectedItems[0].SubItems[0].Text;
strigName2 = lvPlay.SelectedItems[0].SubItems[1].Text;
}
}
}
这是另一边的窗体代码 不管有没有人回答
还是再次谢过 坐等解救.....thank you


  • 怎么地糟糕
  • 五年级
    8
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
代码太长了,没看。。不过估计是你读内存数据同时又去修改它了,我做播放器也遇到这个问题,楼主为什么不去C#吧发帖?


  • 【立華奏】
  • 高二年级
    14
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
“网上说把prvite改public没有用”
你修改的是什么地方?


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 5回复贴,共1页
<<返回c吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示