我想创建一个非常类似于位于系统托盘中的Windows 7音量栏的应用程序.我是Windows开发的新手,想要一个正确的方向.
谢谢你的回复.
我有一个很大的代理服务器列表(txt文件,格式= ip:每行的端口),并编写下面的代码来检查它们:
public static void MyChecker()
{
string[] lines = File.ReadAllLines(txtProxyListPath.Text);
List<string> list_lines = new List<string>(lines);
List<string> list_lines_RemovedDup = new List<string>();
HashSet<string> HS = new HashSet<string>();
int Duplicate_Count = 0;
int badProxy = 0;
int CheckedCount = 0;
foreach (string line in list_lines)
{
string[] line_char = line.Split(':');
string ip = line_char[0];
string port = line_char[1];
if (CanPing(ip))
{
if (SoketConnect(ip, port))
{
if (CheckProxy(ip, port))
{
string ipAndport = ip + ":" + port;
if (HS.Add(ipAndport))
{
list_lines_RemovedDup.Add(ipAndport);
CheckedCount++; …Run Code Online (Sandbox Code Playgroud) 我真的很困惑Parallel.ForEach ...它是如何工作的?
下面的代码有错误 - >File Is In Use
Parallel.ForEach(list_lines_acc, (line_acc, list_lines_acc_state) =>
{
FileStream file =
new FileStream(GPLfilePath, FileMode.Open, FileAccess.ReadWrite);
StreamReader reader = new StreamReader(file);
var processed = string.Empty;
Ok_ip_port = string.Empty;
while (reader.EndOfStream)
{
if (string.IsNullOrEmpty(Ok_ip_port))
{
Ok_ip_port = reader.ReadLine();
}
else
{
string currentLine = reader.ReadLine();
processed += currentLine + Environment.NewLine;
}
}
StreamWriter writer = new StreamWriter(file);
writer.Write(processed);
reader.Close();
writer.Close();
file.Close();
});
Run Code Online (Sandbox Code Playgroud)
你能告诉我怎样才能解决这个问题?这段代码只是一个例子.
我想在Parallel.ForEach中使用字符串数组和列表,但是添加或编辑这些集合总是存在问题.你能举个例子吗?我使用的是Visual Studio 2010 + .NET Framework 4.0
我想在应用程序的窗口中的列表框中添加复选框.
这是我的代码:
CheckBox cb = new CheckBox();
while (dr.Read())
{
listBox1.Items.Add(String.Format("{0} {1}",cb,dr["Stu_Name"]));
}
Run Code Online (Sandbox Code Playgroud)
但是,它没有产生预期的结果.
我想要的是在数据读取器的每个列值之前的复选框?有什么建议?
我使用第三方测试应用程序.我给应用程序测试输入并获得结果.如果我提供大量数据应用程序,它会给出"内存分配错误"当我从任务管理器观察使用过的内存时,我发现当私有字节达到~2Gb时它会给出错误.
我试用了32Bit Windows XP和64Bit Windows 7.结果是一样的.
我该怎么做才能增加第三方应用程序的预留堆内存?我希望它使用超过2Gb的内存.
windows heap memory-management heap-memory windows-applications
我需要插入Windows窗体中必须插入两个表的数据.我正在使用Windows窗体中所有控件的数据源.你能不能请我如何将Windows窗体中的数据同时插入两个表中.
我的桌子是这样的
**product table**
pid salePrice
**Product_tax table**
pid taxid
Run Code Online (Sandbox Code Playgroud)
当我点击提交按钮时,产品ID将自动生成并且salePrice必须同时从表单存储我选择的税还必须存储在product_tax表中以及产品ID.请从这一点帮助我.
提前致谢.
我已将一个文本文件添加到Windows窗体应用程序并尝试访问此文件.
这是我的代码..
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
System.String s = Application.StartupPath+"/Licence.txt";
System.IO.FileInfo fi = new System.IO.FileInfo(s);
if (fi.Exists)
{
if (fi.Length == 0)
{
Application.Run(new Form1());
}
}
}
Run Code Online (Sandbox Code Playgroud)
Licence.txt在我的项目文件夹中,但每次(fi.Exists)都是假的,并且程序来自流程而没有显示Form1()窗口..请帮助我.提前致谢..
c# io file-handling windows-forms-designer windows-applications
我已经进入网络很长时间了,但现在我应该做一个小小的c#项目,我想知道如何重复这样做:

在网上,我可以做
<div id="holder">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
甚至动态地添加它:
var items = [{}, {}, {}, {}];
for ( var i in items ) {
$("#holder").append("<div class=\"item\"></div>");
}
Run Code Online (Sandbox Code Playgroud)
并渲染数组中表示的项目.
我的实际问题是如何使用完全用户控制?
您好,我在网上搜索,无法找到正确的代码或其他内容,以将我的应用程序作为全屏运行.我想制作它,激活全屏模式并自动隐藏标题栏(带按钮).我是Visual Studios和Windows 10应用程序开发的初学者.我正在尝试创建一个JS应用程序.
我只能找到C#/ C++应用程序的全屏模式,但找不到JS.
https://github.com/JustinXinLiu/FullScreenTitleBarRepo/tree/master/FullScreenTitleBarRepo
fullscreen windows-applications windows-10 visual-studio-2015 uwp
我正在Windows 10平台上开发Universal Window App,我的页面如下所示:

主页面包含一个带有4个透视项目的旋转控件(PAGE 1,PAGE 2,...).第1页包含一个红色stackpanel,其中包含一个带水平滚动的列表视图.
我的问题是,当我想要滚动我的红色列表视图时,我的支点滑动到下一页.我想在列表视图滚动期间禁用枢轴滑动(但仅在列表视图滚动期间).
我试图从listview获取scrollviewer并从scrollviewer监听viewChange以禁用数据透视滑动但没有成功.一切正常但将IsHitTestVisible设置为false似乎不起作用.这是我的代码:
ScrollViewer scrollViewer = ListViewHelper.GetScrollViewer(myListView);
scrollViewer.ViewChanged += scrollview_ViewChanged;
private void scrollview_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
{
var scrollviewer = sender as ScrollViewer;
if (e.IsIntermediate)
{
mainPivot.IsHitTestVisible = false;
} else
{
mainPivot.IsHitTestVisible = true;
}
}
Run Code Online (Sandbox Code Playgroud)
而我的ListViewHelper类:
public static class ListViewHelper
{
public static ScrollViewer GetScrollViewer(this DependencyObject element)
{
if (element is ScrollViewer)
{
return (ScrollViewer)element;
}
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(element); i++)
{
var child = VisualTreeHelper.GetChild(element, …Run Code Online (Sandbox Code Playgroud) c# ×8
uwp ×2
windows ×2
.net ×1
.net-4.0 ×1
file ×1
fullscreen ×1
heap ×1
heap-memory ×1
io ×1
proxy ×1
read-write ×1
sql ×1
system-tray ×1
windows-10 ×1
winforms ×1
xaml ×1