自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 C#中DataTable使用

<br />DataTable dt=new DataTable();<br /> <br />sql = "select categoryid,categoryname from categories where categorytype='5'";<br />cmd = new SqlCommand(sql,sqlConnDes);<br />SqlDataAdapter sda = new SqlDataAdapter(cmd);<br />sda.Fill(dt);<br /> fo

2010-12-09 12:14:00 414

原创 C#streamwriter写文件

using System;<br />using System.IO;<br /><br />class Test <br />{<br />publicstaticvoid Main() <br /> {<br />string path = @"c:/temp/MyTest.txt";<br />// This text is added only once to the file.<br />if (!File.Exists(path)) <br />

2010-11-21 15:59:00 1311

原创 C#中更改groupbox的边框的颜色

<br />e.Graphics.Clear(groupBox1.BackColor);<br /><br />e.Graphics.DrawString(groupBox1.Text, groupBox1.Font, Brushes.Blue, 10, 1);<br /><br />e.Graphics.DrawLine(Pens.Black, 1, 7, 8, 7);<br /><br />e.Graphics.DrawLine(Pens.Black, e.Graphics.MeasureS

2010-11-18 16:56:00 7740 1

转载 远程调用webservice

<br />如果使用VS2005以后开发的<br />Web Service默认情况下是不支持远程调试的,因此Web.config文件中的<br /><system.web>节点下加入如下信息: <br />       <webServices><br />            <protocols><br />                 <add name="HttpGet"/><br />                 <add name="HttpP

2010-08-26 14:51:00 3487

转载 C#调用webservice

<br />假设A是客户端,B是webservice服务端,用户通过http协议向服务器发送soap请求,webservice返回客户端XML格式的数据。 <br />  现在我们看一看创建一个webservice的大致过程: <br />  服务端的webservice是必须要建的。中间的soap,xml我们不用去关心,在客户端这边,比较重要的是如何从webservice取得对象?答案是用的是proxy对象。客户端由代理对象(proxy)负责与webservice的通信。所以在客户端使

2010-08-26 00:06:00 681

转载 C#接收邮件函数

<br />public void ConnectToServer(NetworkStream ns,StreamReader sr,string serverName,string serverPassword)<br />        {<br />            string temp = "";<br /><br />            data = "USER " + serverName + "/r/n";<br />            szdata = Sys

2010-08-24 19:44:00 512

转载 C#smtp发送邮件

<br />MailMessage mail = new MailMessage();<br /><br />            mail.Subject = toAddress.Text;<br />            mail.From = new MailAddress("[email protected]");<br /><br />            mail.To.Add(toAddress.Text);<br />            mail.Subject = subjec

2010-08-24 19:39:00 349

转载 pythonic examples

pythonic examples<br />文章分类:Python编程<br /> <br />1. 百分号的使用:<br />通常我们都是这样格式化字符串的:<br /> Python代码 print 'hello world programme by %s' % 'python'  print 'hello world programme by %s' % 'python'<br /> <br /> 但是如果格式化的字符串中有很多%s,那么程序的可读性就会依靠于%后面 的变量名起得是否好了。<br /

2010-08-20 19:44:00 554

原创 c#实现资源浏览器

<br />using System;<br />using System.Collections.Generic;<br />using System.ComponentModel;<br />using System.Data;<br />using System.Drawing;<br />using System.Linq;<br />using System.Text;<br />using System.Windows.Forms;<br />using Syst

2010-08-17 19:51:00 1029 2

原创 C#TreeView显示本地资源

<br />using System;<br />using System.Collections.Generic;<br />using System.ComponentModel;<br />using System.Data;<br />using System.Drawing;<br />using System.Linq;<br />using System.Text;<br />using System.Windows.Forms;<br />using Syst

2010-08-17 17:24:00 482

原创 C#的checkedlistbox删除操作代码

<br />/*int count=checkedListBox1.CheckedItems.Count;<br /> for (int i=0;i<count;i++) <br />{<br />     heckedListBox1.Items.Remove(checkedListBox1.CheckedItems[0]);<br />}*/<br /><br />int count = checkedListBox1.CheckedIndices.Count;<br /> fo

2010-08-16 14:42:00 1209

转载 python中使用getopt

<br />在运行程序时,可能需要根据不同的条件,输入不同的命令行选项来实现不同的功能。目前有短选项和长选项两种格式。短选项格式为"-"加上单个字母选项;长选项为"—"加上一个单词。长格式是在Linux下引入的。许多Linux程序都支持这两种格式。在Python中提供了getopt模块很好的实现了对这两种用法的支持,而且使用简单。<br />取得命令行参数<br />在使用之前,首先要取得命令行参数。使用sys模块可以得到命令行参数。import sys<br /><br />print sys

2010-08-14 13:18:00 453

转载 利用urllib下载图片

<br />ubuntu查找文件:<br /> sudo find / -name sources.list<br /> 实现图片下载  import urllib  url = r"http://www.javaeye.com/images/logo.gif"  path = r"h:/downloads/1.jpg"  data = urllib.urlopen(url).read()  f = file(path,"wb")  f.write(data)  f.close()  <br />

2010-08-13 19:41:00 1002

转载 Ubuntu挂载vbox共享空间

<br />设备-分配数据空间-添加数据空间<br />设置好数据空间位置和名字(注意:固定还是临时看你自己是要长期共享还算临时共享,共享文件夹名最好填写英文。)<br />已共享文件夹名为“vv15”为例演示如何挂载共享空间(Ubuntu中)<br />挂载共享文件夹<br />重新进入虚拟Ubuntu,在命令行终端下输入:<br />sudo mkdir /mnt/shared<br />sudo mount -t vboxsf vv15 /mnt/shared<br />其中”vv15″是之前

2010-08-12 20:28:00 2106

转载 MySql 基本操作

<br />MySQL数据库的基本操作命令<br />=========================<br /><br />一、mysql服务操作<br />1、service mysql start //启动mysql服务<br /><br />2、service mysql stop//停止mysql服务 <br /><br />3、mysql -h主机地址 -u用户名 -p用户密码 //进入mysql数据库<br /><br />4、quit

2010-08-12 19:39:00 372

原创 c#连接sqlite数据库

<br />using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Text;<br />using System.Data.SQLite;<br /><br />namespace Test<br />{<br />    class Program<br />    {<br />        static void Main(str

2010-08-10 21:28:00 1398

原创 c#sqlcommand 使用方法

<br />使用sqlcommand对象来返回数据集合的方法<br />string strconn="data source=billgates;initial catalog=test;integrated security=SSPI;";<br />SqlConnection conn=new SqlConnection(strconn);<br />conn.Open();<br />SqlCommand sqlcmd=new SqlCommand();<br />sqlcmd.

2010-08-10 18:59:00 15145 2

原创 c#实现的音频入库

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;using System.IO;namespace inDb

2010-08-10 17:32:00 612

转载 python文件读写

<br />文件的读写<br /> <br />一、文件打开:<br />f = file(name[, mode[, buffering]])<br />入口参数:   name 文件名<br />                  mode   选项,字符串<br />                  buffering   是否缓冲 (0=不缓冲,1=缓冲, >1的int数=缓冲区大小)<br />返回值 : 文件对象<br />mode 选项:<br />"r"   以读方式打开,只能

2010-08-10 11:47:00 1248

原创 python写的统计PYTHON文件的(代码行数,空行数,注释行数)小程序

#-*-coding:utf-8-*-import osif __name__=='__main__':    codeline=0    expline=0    blankline=0    filename=raw_input('Please input the  file name:')    fi=open(filename)    while fi.tell()!=os.path.getsize(filename):        temp=fi.readli

2010-08-09 21:03:00 2805

转载 list排序(转)

Python: How to Sort a List<br />很多时候,我们需要对List进行排序,Python提供了两个方法<br />对给定的List L进行排序,<br />方法1.用List的成员函数sort进行排序<br />方法2.用built-in函数sorted进行排序(从2.4开始)<br />这两种方法使用起来差不多,以第一种为例进行讲解:<br />从Python2.4开始,sort方法有了三个可选的参数,Python Library Reference里是这样描

2010-08-08 21:00:00 451

原创 C#实现的简单ftp客户端

<br />using System;<br />using System.Collections.Generic;<br />using System.ComponentModel;<br />using System.Data;<br />using System.Drawing;<br />using System.Linq;<br />using System.Text;<br />using System.Windows.Forms;<br />using Syst

2010-08-07 17:48:00 5019

转载 python获取url地址中的参数

>>> url = 'http://localhost/test.py?a=hello&b=world'  >>> values = url.split('?')[-1]  >>> values  'a=hello&b=world'  >>> for key_value in values.split('&'):  ...     print key_value.split('=')  ...   ['a', 'hello']  ['b', 'world']  <br />

2010-08-02 17:04:00 12401

转载 python 批量更改后缀名

#-*-coding:utf-8-*-import osif __name__=='__main__':    old_ext=input('Please input the old ext:')    new_ext=input('Please input the new ext:')    for (path,dirs,filenames) in os.walk('/root/Programs'):        print 'jump in to the first for/n

2010-08-01 13:58:00 863

转载 C#读取数据库表数据输入listview

<br />using System;<br />using System.Collections.Generic;<br />using System.ComponentModel;<br />using System.Data;<br />using System.Drawing;<br />using System.Linq;<br />using System.Text;<br />using System.Windows.Forms;<br />using Syst

2010-07-31 20:40:00 4585 2

转载 C#连接SQL SERVER数据库

<br />using System;<br />using System.Collections.Generic;<br />using System.ComponentModel;<br />using System.Data;<br />using System.Drawing;<br />using System.Linq;<br />using System.Text;<br />using System.Windows.Forms;<br />using Syst

2010-07-31 15:19:00 465

转载 判断远端服务器端口是否通的脚本

<br />import socket<br />sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br />sk.settimeout(1)<br />try:<br />    sk.connect(('192.168.0.1',21))<br />    print 'Server port 21 OK!'<br />except Exception:<br />    print 'Server port 21

2010-07-30 11:02:00 488

转载 python 计算下一个星期三的日期

import datetime,calendarif __name__=='__main__':    day_time=datetime.date.today()    oneday=datetime.timedelta(days=1)    while day_time.weekday() != calendar.WEDNESDAY:        day_time += oneday    print day_time.strftime('%A,%d-%b-%Y')其中strf

2010-07-29 13:50:00 1591

转载 python ftp上传文件代码

<br />from ftplib import FTP<br /><br />if __name__=='__main__':<br />    ftp=FTP()<br />    ftp.connect('192.168.4.152','21')<br />    ftp.login('ftpuser','ftpuser')<br />    print ftp.getwelcome()<br />    print ftp.dir()<br />    buffersiz

2010-07-29 10:10:00 454

转载 windows python 访问ftp

在windows下python访问ftpfrom ftplib import FTPimport timeif __name__=='__main__':    ftp=FTP()    ftp.connect('192.168.4.152','21')    ftp.login('ftpuser','ftpuser')    print ftp.getwelcome()    ftp.cwd('demonstrate') #set the current of the dire

2010-07-28 19:37:00 892

原创 python操作xml

<br />利用DOM来创建和修改xml<br />DOM的具体教程在http://www.w3school.com.cn/xmldom/index.asp<br />doc = minidom.Document()在内存中创建一个Document对象<br />修改好xml以后,将内存中的数据写入xml文件中<br />file=open('library','w')<br />doc.writexml(file, "/t", "/t", "/n", "utf-8")<br />除

2010-07-28 14:39:00 336

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除