我不明白错误在哪里...
using System.Xml.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace xmldow
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void clickBott(object sender, RoutedEventArgs e)
{
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(new Uri("http://example.net/ddd/my.xml"));
}
void client_DownloadStringCompleted(Object sender, DownloadStringCompletedEventHandler e)
{
throw new NotImplementedException();
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
错误1'client_DownloadStringCompleted'没有重载匹配委托'System.Net.DownloadStringCompletedEventHandler'
谢谢
我有一个使用farmula 从RGB图像创建的灰度图像:
现在,我想尽可能将灰度图像转换回接近原始的RGB彩色图像.
我试过在互联网上找它,但找不到怎么做.维基百科建议它有可能但不解释如何.
0.3 * c.r + 0.59 * c.g + 0.11 * c.b
有人可以建议我该怎么做.
提前致谢.
我必须使用LINQ/Lambda而不是ForEach循环.以下是我的代码
List<CatalogItem> catalogItems = new List<CatalogItem>();
foreach (TreeViewItem item in this.SelectedItems)
{
if (item.DataContext is CatalogItem)
{
catalogItems.Add((CatalogItem)item.DataContext);
}
}
Run Code Online (Sandbox Code Playgroud)
我想知道如何在LINQ中使用'is'运算符.
我试过了
this.SelectedItems
.Where(item => item.DataContext is CatalogItem)
.Select(item => item.DataContext)
Run Code Online (Sandbox Code Playgroud)
但没有得到理想的结果.请帮忙.
con.Open();
string query = "select Calf_ID,Plant,date1,Event from Holiday_Master ";
cmd = new SqlCommand(query, con);
cmd.CommandType = CommandType.Text;
dr = cmd.ExecuteReader();
while (dr.Read())
{
Label1.Text = dr["Calf_ID"].ToString();
Label2.Text = dr["Plant"].ToString();
Label3.Text = dr["date1"].ToString();
Label4.Text = dr["Event"].ToString();
}
con.Close();
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码,但它只从表中检索一行我想要表中的所有数据.
我有table1Name,填充了数据,table2没有填充数据.
select * from [database1Name].dbo.table1Name
join [database1Name].dbo.table2Name
on [database1Name].dbo.table1Name.fieldName like value;
Run Code Online (Sandbox Code Playgroud)
运行上面的sql语句后,它会加入表,但不会显示表'table1Name'中的任何填充数据.
为什么会这样?
我有一个界面
/// <summary>
/// Summary description for IBindable
/// </summary>
public interface IBindable<T>
{
// Property declaration:
T Text
{
get;
set;
}
}
Run Code Online (Sandbox Code Playgroud)
现在我想在我的类中实现这个接口
public class MyTextBox :IBindable<string>
{
//now i how can i implement Text peroperty here
}
Run Code Online (Sandbox Code Playgroud)
我不想像它那样实现它
string IBindable<string>.Text
{
get { return "abc";}
set { //assigne value }
}
Run Code Online (Sandbox Code Playgroud)
我想像它一样实现它
public string Text
{
get{} set {}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试解码像' BHQsZMaQQok=' 这样的字符串.
我所知道的字符串是它必须是一个数字.如果有必要,我可以找到更多加密的字符串.
问题:
我有一个字符串说:"I am a boy".
我需要一个正则表达式,将字符串中的所有字符转换为"*".
提前致谢.
我有一个我预先定义为长度为2的数组.
private int[] numbers = new int[2];
Run Code Online (Sandbox Code Playgroud)
现在,我想编写一个方法,创建一个具有当前状态的双倍大小的数组,并将所有数据复制到它.然后它将数组引用分配给这个新引用.关于如何从方法开始的任何想法?