DataBinding XmlDataSource.zip及行政区划数据
使用C#+WPF的一个DataBinding With XmlDataSource Demo ,实现省市区行政区划联动
dyArithmetic.zip
数据结构与算法的学习对于进行软件开发的专业程序员而言是非常关键的。虽然 有许许多多关于数据结构与算法的书籍,但是这些书籍通常都是大学教材,而且是用 在大学里经典讲授的 Java 语言或 C++语言编写的。C#语言正在成为一种广受欢迎 的编程语言。这本书为 C#语言程序员提供了学习基础数据结构与算法的机会。 C#语言植根在一个功能非常丰富的.NET 框架开发环境中。在.NET 框架库中包 含有一套数据结构类(也称为集合类)。这套类的范围从 Array 类、ArrayList 类和Collection 类到Stack 类和Queue 类,再到 Hashtable 类和 SortedList 类。学习数据结构与算法的学生在学习如何实现它们之前可以先明白 如何使用数据结构。以前老师在构建完整的堆栈数据结构之前只能抽象地讲解堆栈的 概念。而现在老师可以立刻通过示范数据结构工具来向学生们展示如何用堆栈执行一 些计算,比如数制之间的转换。有了这些知识后,学生可以课后学习数据结构(或算 法)的基本原理,甚至可以构造属于他们自己的实现
JHJSolution.zip
基于WCF登录服务实现
1.部署需求
2.登录界面
3.服务搭建
3.1 JIS.IService 项目
3.2 JIS.Service 项目
3.3 JIS.Host 项目
step 1:配置服务
step 2:宿主程序
step 3:运行服务
4. 客户端Client实现
6.WPF客户端登录实现
6.1 App.xaml.cs
6.1 登录窗体WLogin.xaml
6.2 WLoginViewModel
6.3 WLogin.xaml.cs
6.4 PasswordBoxHelper
LoginDemo.rar
一个很不错的WPF登录demo,充分利用了自定义组件和事件处理方法,实现了登陆验证后切换登录窗体与主窗体切换.
phantomjs-2.1.1-windows.zip
phantomjs-windows.zip。 一般常用的请求方式,返回报文。但是有时候遇到到动态加载的页面,却只能抓取部分内容,无法抓取到动态加载的内容。
如果遇到这种的话,推荐使用phantomJS无头浏览器
WPFamChartsK线制作.zip
C#+WPF 股票K线制作 根据 时间/ 开盘价/ 最高价/最低价/ 收盘价 / 成交量 生成K线图,
快捷输入代码段mysnippet2
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
<CodeSnippet Format="1.0.0">
<Header>
<Title>mypn</Title>
<Shortcut>mypn</Shortcut>
<Description>自动实现的属性的代码片段
NotifytionObject</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>属性类型</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>属性名</ToolTip>
<Default>MyProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public $type$ $property$
{
get{ return this.$property$;}
set{
this.$property$=value;
RaisePropertyChanged(()=>$property$)
}
}$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
快捷输入代码段mysnippet1
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
<CodeSnippet Format="1.0.0">
<Header>
<Title>mypc</Title>
<Shortcut>mypc</Shortcut>
<Description>自动实现的 ICommand 命令的代码片段
RelayCommand</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>属性类型</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>属性名</ToolTip>
<Default>MyProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[private ICommand _$property$;
public ICommand $property$
{
get {
if (this._$property$ == null)
{
this._$property$ = new RelayCommand($property$Action);
}
return this._$property$;
}
}$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Prism MVVM应用 登陆后切换主窗体实现
应用场景
使用Prism7开发WPF程序,编码采用MVVM形式。当程序启动时,首先进入一个登陆界面,进行登陆认证,认证成功后转入程序布局主窗口。
设计思路
WPF程序框架搭建后,程序中存一个Shell.xaml,相当于表演者的唯一舞台。登陆窗体(以下简称 LoginView)和程序布局主窗体(以下简称 MainView),分别利用IRegionManager进行管理,根据需要在不同时机相继出场表演。所有操作均由各自ViewModel(简称VM)代码完成。
1.当程序启动后,Shell通过VM,使用RegionManager的Add方法激活LoginView。登陆操作后,发送消息loginState消息。该消息的发送是通过一个自定义的消息发送和订阅类来完成的(程序中将定义为:LoginSentEvent)。
2.Shell通过VM接受LoginSentEven传递的loginState来接收登陆成功与否的消息,如果登陆成功,则使用RegionManager的Deactivate方法使LoginView处于非激活隐藏。利用 Add方法使MainView视图激活。如果不成功呢,当然不改变视图了,继续登陆操作。
RTF文件内容的字符串读取
从实战项目中抽取的一段代码,用于RTF文件内容的字符串读取.
C# 全局快捷键定义 隐藏显示窗体
项目中摘取的利用全局快捷键显示和隐藏窗体的demo示例
Word Ico下载
word 界面中一些字体操作的图标,很不错,是开发各类编辑类工具首选.
动态改变IP
本文件是C#代码片断 public Form1()
{
InitializeComponent();
}
int i = 0;
int j = 0;
string[] proxys;
#region 改变代理
[DllImport("wininet.dll", SetLastError = true)]
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
///
public void RefreshIESettings(string strProxy)
{
const int INTERNET_OPTION_PROXY = 38;
const int INTERNET_OPEN_TYPE_PROXY = 3;
Struct_INTERNET_PROXY_INFO struct_IPI;
// Filling in structure
struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
struct_IPI.proxy = Marshal.StringToHGlobalAnsi(strProxy);
struct_IPI.proxyBypass = Marshal.StringToHGlobalAnsi("local");
// Allocating memory
IntPtr intptrStruct = Marshal.AllocCoTaskMem(Marshal.SizeOf(struct_IPI));
// Converting structure to IntPtr
Marshal.StructureToPtr(struct_IPI, intptrStruct, true);
bool iReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, Marshal.SizeOf(struct_IPI));
}
#endregion
private void Form1_Load(object sender, EventArgs e)
{
proxys = File.ReadAllLines("C:/proxy.txt");
}
private void timer1_Tick(object sender, EventArgs e)
{
if (i < proxys.Length)
{
label2.Text = proxys[i];
label9.Text = i.ToString();
label3.Text = "waiting...";
RefreshIESettings(proxys[i]);
webBrowser1.Navigate("http://www.imwq.net");
timer1.Enabled = false;
i++;
}
else
{
timer1.Enabled = false;
button1.Text = "结束";
}
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
label3.Text = "ok...";
timer1.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
}
struct Struct_INTERNET_PROXY_INFO
{
public int dwAccessType;
public IntPtr proxy;
public IntPtr proxyBypass;
};
利用VBA统计数据分布一例
利用VBA实现对比数据计算分布,对VBA初学者是很好的借鉴。
部分代码如下:
Dim rng As Range, tp As Range, arr, i As Long, j As Long
Set rng = Range("S2:AD" & Cells(Rows.Count, "S").End(xlUp).Row)
arr = rng
For i = 2 To UBound(arr, 1)
For j = 2 To UBound(arr, 2)
If arr(i, 1) = arr(1, j) Then
arr(i, j) = 0
Else
If i = 2 Then arr(i, j) = 1 Else arr(i, j) = arr(i - 1, j) + 1
End If
Next j
Next i
[s2].Resize(UBound(arr, 1), UBound(arr, 2)) = arr
For Each tp In rng.Offset(1, 1).Resize(UBound(arr, 1) - 1, UBound(arr, 2) - 1)
If tp.Value = 0 Then tp.Interior.ColorIndex = 3
Next tp
MsgBox "统计分布完毕!", vbInformation, ""
End Sub
只用一句SQL计算名次
只用一句SQL计算名次,允许并列,搜集整理下来,供大家珍藏
delphi+report machine 成绩统计排名
利用d7+access开发,依据学生成绩总分、各科分数,实现校排名,各班分别排名等等。
chm制作转换小工具
用于chm制作,txt\html等格式转换为chm的工具,内含破解,用了就知道了
win7主题11221
win7主题,我比较喜欢!win7主题,我比较喜欢!