请教关于获取XML序列化类的XMLElement元素的值的方法
- C# code
-
[XmlElement("all_count")] public long AllCount { get; set; } [XmlElement("bulletin")] public string Bulletin { get; set; } //xml这块我不太熟悉,请问我能获取到all_count,bulletin吗? //传入一个已经序列化的类,得到所有的xmlelment属性值,最后拼成一个字符串返回
[XmlElement("all_count")] public long AllCount { get; set; } [XmlElement("bulletin")] public string Bulletin { get; set; } //xml这块我不太熟悉,请问我能获取到all_count,bulletin吗? //传入一个已经序列化的类,得到所有的xmlelment属性值,最后拼成一个字符串返回
小弟对线程控制不是很了解,希望有高人能指点一二。
我现在有个疑问,在winform中的某窗体上有2个按钮,这2个按钮分别执行2个不同的操作。现在我的问题来了,为什么我按下按钮1,在按钮1还在执行过程中想去按下按扭2,但是事与愿违。由于线程的缘故,按钮2必然不能按,请问有没有方法可以按下按钮2?或者解释下为什么按钮2是不能按下?
比如说,DataSet要获取数据库中表“A”,但"A"中数据量有3GB,那么DataSet是一次性把“A”中全部数据都加载到内存中吗?
一个目标客户跟踪系统,(VS2005 ,SQL2000)
里面有许多条记录: 销售代表,客户名称,联系人,联系电话,联系日期等。
问题1
在销售代表录入客户名称时,如果录入的客户名称与数据库中其他同事录入的客户名称有6个字以上的相同,系统弹出窗口,提示已经存在的客户有:*****,并列出雷同的客户名称,请问如何实现?
问题2
该销售看到提示了,但还是保存记录。
管理员想从后台的一个查询窗口,查询所有近期录入的此类型的记录,此查询如何实现?
管理人员不希望多个销售同时联系一个相同的客户。
重新生成时出现错误提示。
“asp:ListItem”的“Text”属性不允许子对象。
出错代码:
<asp:DropDownList ID="Cbochrrebear" runat="server" CssClass="InputField" Width="160px">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"01">一孩残疾(01)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"02">残(烈)军人(02)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"03">丧偶再婚(03)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"04">离婚再婚(04)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"05">一方华(归)侨(05)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"06">代领后孕(06)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"07">两代或双独(07)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"08">井下作业(08)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"09">海洋捕捞(09)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"10">一方独子(10)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"11">一个生育(11)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"12">一女招婿(12)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"13">一子一女(13)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"14">沿海垦区(14)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"15">特殊(15)</asp:ListItem>
<asp:ListItem Value=http://topic.csdn.net/u/20110304/17/"16">其他(16)</asp:ListItem>
</asp:DropDownList>
为什么在窗体上显示和在打印显示的字符宽度不一样?为什么,怎么能弄成一样的呢
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Font font = new Font("宋体", 1);
SizeF size = e.Graphics.MeasureString("A", font);
float f = size.Width;//1.17910862
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Font font = new Font("宋体", 1);
SizeF size = e.Graphics.MeasureString("A", font);
float f = size.Width;//1.1319443
}
private void button1_Click(object sender, EventArgs e)
{
printPreviewControl1.Document = printDocument1;
printDocument1.Print();
}
各位好:
我在一个程序里声明了两个socket分别是client和server。
我希望通过client给server发ping包,类似于ping127.0.0.1的效果,但是sever总是控制不好,或者是拥塞模式搞的界面刷不出来,或者是显示不能立即完成一个非阻挡性套接字操作,我也试过使用beginaccept的方法,但同样不好使,求各位给帮帮忙。小弟这里散分了,谢谢。
如题:我想直接在DataGridView中输入多行数据,输完之后直接点提交按钮就可以将数据提交到数据库中,该怎么做?
假设数据表为test。里面字段有name,age。
事实上是做分页(有100W条数据)
那么主要的是我想这样
我想查询的20条到第39条之间的数据
该怎么写Sql语句?
我做了一个小球打砖块的程序,小球通过timer控件不断的进行坐标++,使得小球进行移动,然后挡板我用keydown事件写了,但是不管用,怎么办?断点执行的时候我发现程序在timer里循环起来,不往下执行了…….keypreview已经改为TRUE……小弟在这里求教了~!
我在WinForm中想把Excel文件读到WebBrowser\控件里,或者说用WebBrowser控件显示Excel文件。
问题是:this.webBrowser1.Navigate("E:\\dd\\tt.xls");设置完属性
或者
string strFileName = "E:\\zh\\abc.xls";
Object refmissing = System.Reflection.Missing.Value;
oDocument = null;
axWebBrowser1.Navigate(strFileName, ref refmissing, ref refmissing, ref refmissing, ref refmissing);
运行后发现并没有把Excel文件读到WebBrowser控件里,Excel文件以Office形式在本地打开了,而WebBrowser控件里显示如图,希望有类似经历
的编程人员给些帮助。
axWebBrowser情况与WebBrowser一样。
也可以这里留言
http://zhidao.baidu.com/question/210466144.html
我希望是在后台的controller返回,使前台网页调用一段js代码,比如这段JS代码是:
alert("success");
form上有一个DataGridView
运行时单击左上角的列头,就自动全选
我想自己写一个方法,将其变成双击列头才全选
但是写完后,发现单击双击都好用
怎样才能把原来单击全选给取消呢?不知道是哪个属性,试了好多都不对
问题就一句话实现全局监听当用户按下CTRL键时点击鼠标左键,响应的鼠标右键的功能。
这个一个朋友问我的问题。对于全局热键还有所熟悉,刚开始认为很简单的事情。
细想下来却发现非常复杂。
目前的想法是当用户按下ctrl键时 timer启动监听 用户按下鼠标左键记录坐标点 根据坐标模拟一次鼠标右键。
但是觉得用timer非常笨拙,求高人的解决方法。代码
语言不限。
我用的是vb6
小弟 初学 C#
看看如下代码 有什么问题 。。 不回调Client_DownloadStringCompleted 是啥问题?
class test { public static void Main() { A testA = new A(); testA.Download(); } } class A { private WebClient _webclient; public void Client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { (sender as WebClient).DownloadStringCompleted -= new DownloadStringCompletedEventHandler(Client_DownloadStringCompleted); string _outpustring = e.Result; Console.WriteLine(_outpustring); } public void Download() { _webclient = new WebClient(); this._webclient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(this.Client_DownloadStringCompleted); Uri _DownloadUri = new Uri("http://sample.adenova.fr/?feed=svp-podcast"); this._webclient.DownloadStringAsync(_DownloadUri); } }
public event PortNumberReadyEventHandler PortNumberReady {
add {
((MessageReceiver)receiver).PortNumberReady += value;
}
remove {
((MessageReceiver)receiver).PortNumberReady -= value;
}
}
能帮我解释一下这个事件是干什么用的么?((MessageReceiver)receiver).PortNumberReady += value;
这句话是什么意思啊?