Google [站内搜索]

分类: Win编程预览模式: 普通 | 列表

VB6.0获取网页源代码

'说明:获取网页源代码
'参数:
'   url: 链接地址
'   encoding: 页面编码,gb2312、utf-8等
Public Function GetResponse(ByVal url As String, ByVal encoding As String) As String

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7826

C#的lock语句

using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6130

ComboBox绑定数据源示例

using (SqlConnection conn = new SqlConnection("server=127.0.0.1;database=northwind;user id=sa;password=sa;"))
{
    using (SqlDataAdapter adapter = new SqlDataAdapter("select top 10 ProductID,ProductName from Products", conn))
    {
        DataTable table = new DataTable();

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5762

C#调用windows图片查看器打开指定图片

System.Diagnostics.Process.Start("rundll32.exe", string.Format("{0} {1}", "shimgvw.dll,ImageView_Fullscreen", @"f:\demo.bmp"));

查看更多...

分类:Win编程 | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 8889

C#计算文件MD5值

/// <summary>
/// 文件路径
/// </summary>
/// <param name="path"></param>
/// <returns></returns>

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4859

[C#] Sql Server2000图片存取技术

//存储
private void button1_Click(object sender, EventArgs e)
{
    using (SqlConnection conn = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=Northwind;User ID=sa;Password=sa"))
    {

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4350
Button、PictureBox、Label等控件默认BackColor属性值是SystemColors.Control,但在一些自定义界面的窗体中,需要这些控件能和窗体融合,就要将其背景为透明,只要将BackColor属性值设置为Color.Transparent(WEB→Transparent)即可:



下边来看复杂一点的情况,界面上有pictureBox1和pictureBox2,pictureBox2在pictureBox1上边,将pictureBox2的BackColor属性值设置为Color.Transparent后,效果如下:

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 8345

C#读取资源文件(Resources.resx)中的内容

平时我们可以将字符串、图像、图标、音频、文件等资源存放在resx文件中,vs会自动生成一个强类型资源类Resources,读取资源文件的内容很简单:

Properties.Resources.资源名称

例如:

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 15520

C#移动无标题栏窗体代码

假如隐藏窗体默认标题栏后,在窗体顶部放置一个Panel控件做自定义标题栏,拖动窗体代码如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5097

VB获取窗体上的按钮控件并单击示例

例一:自动点击计算器上的个按钮

Module1.bas:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 8107