设置属性(任何一个)的最快方法null是IEnumerable什么?是foreach我唯一的选择吗?
我的WordPress网站位于英国.我能到HTML改变lang-attribute从en-US到en-GB时,我认为我的源代码,但og:locale作为开放图表显示的属性en-US,它是由yoast SEO插件生成.有没有办法将区域设置更改为en-GB?
我正在创建一个Windows Phone应用程序,我将在文本文件中存储级别数据.
我有以下问题:我试图从文件中读取所有行,每次我调用Application.GetResourceStream它返回null.
我知道这个话题是由不同的人提出的,但所有的解决方案都不适合我.
这是代码:
List<String> fileLines = new List<string>();
var resource = Application.GetResourceStream(
new Uri("Level_data/Level_1.txt", UriKind.Relative));
StreamReader streamReader = new StreamReader(resource.Stream);
string line;
while ((line = streamReader.ReadLine()) != null)
fileLines.Add(line);
Run Code Online (Sandbox Code Playgroud)
此外,解决方案资源管理器看起来像这样.构建操作设置为"资源",但我也首先尝试"内容",但也没有工作.
我想在WinForm上创建一系列RadioButton.它工作正常,但在Click-event中我想捕获产品ID并用它来做.我习惯于HTML元素,并将数据分配给RadioButton的标签和值.使用WinForms,我看不到与value属性等价的东西.
关于如何将产品ID传递给RadioButton Change-event的任何好建议?
var products = new Business.Products().GetAll();
if (!products.Any())
GrpCategories.Controls.Clear();
int y = 2;
int x = 2;
foreach (var product in products)
{
var btn = new RadioButton();
btn.Width = 100;
btn.Height = 20;
if (y >= GrpCategories.Height - btn.Height - 10)
{
x += btn.Width + 2;
y = 2;
}
y += btn.Height + 2;
btn.Appearance = Appearance.Button;
btn.Text = product.Name;
btn.Name = "BtnProduct_" + product.ID;
btn.Location = new Point(x, y);
GrpCategories.Controls.Add(btn);
}
Run Code Online (Sandbox Code Playgroud)