上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 70 下一页
摘要: FileUpload控件,主要用来上传文件。关键的方法就是saveas(),即将本地文件“另存到"(上传)服务器的某个指定的目录.FileUpload.aspx内容:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FileUpLoad.aspx.cs" Inherits="FileUpLoad" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/ 阅读全文
posted @ 2011-12-06 15:19 MXi4oyu 阅读(200) 评论(0) 推荐(0) 编辑
摘要: SQL语句利用SqlCommand传参数的方法:string strSQL="SELECT * FROM [user] WHERE user_id=@id";SqlCommand cmd = new SqlCommand();cmd.CommandText = strSQL;cmd.Parameters.Add("@id",SqlDbType.VarChar,20).Value=Request["id"].ToString();过滤禁止运行法: /// <summary> /// 过滤SQL语句,防止注入 /// < 阅读全文
posted @ 2011-12-06 11:21 MXi4oyu 阅读(174) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 该方法用来检测用户输入是否带有恶意 /// </summary> /// <param name="text">用户输入的文字</param> /// <param name="maxlength">最大的长度</param> /// <returns>返回验证后的文字</returns> public static string InputText(string text, int maxlength) { text = 阅读全文
posted @ 2011-12-06 11:18 MXi4oyu 阅读(191) 评论(0) 推荐(0) 编辑
摘要: public class SqlCheck { public SqlCheck() { // // TODO: 在此处添加构造函数逻辑 // } public SqlConnection oconn() { SqlConnection conn = new SqlConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["StudyConnectionString"].ToString(); //第1种调用的方法 JK1986_CheckSql(); JK1986_Chec... 阅读全文
posted @ 2011-12-06 10:28 MXi4oyu 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 第一步:设置web.config<authentication mode="Forms"></authentication>,如果web.config中已经有authentication 只要添加mode="Forms"节或者可能默认是mode="Windows",修改成如上即可。第二步:新建一个独立用户登录的类:using System;using System.Collections.Generic;using System.Text;using System.Web;using System.Web.Se 阅读全文
posted @ 2011-12-05 10:13 MXi4oyu 阅读(149) 评论(0) 推荐(0) 编辑
摘要: //SearchIPAdress 类(SearchIPAdress.cs)using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace QQClient{ public partial class SearchIPAdress : Form { public SearchIPAdress() { InitializeComp 阅读全文
posted @ 2011-12-04 11:01 MXi4oyu 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 1,String类有不可改变性。每次执行字符操作时,都会创建一个新的String对象。2,StringBuilder 类解决了对字符串进行重复修改的过程中创建大量对象的问题。初始化一个StringBuilder 之后,它会自动申请一个默认的StringBuilder 容量(默认值是16),这个容量是由Capacity来控制的.并且允许,我们根据需要来控制Capacity的大小,也可以通过Length来获取或设置StringBuilder 的长度.=========================================================================== 阅读全文
posted @ 2011-12-03 10:06 MXi4oyu 阅读(145) 评论(0) 推荐(0) 编辑
摘要: int?型的值可以直接付给int型的,只是因为int型不能为null,而int?型可以为null,所以要加个判断int? a;int b;if(a.HasValue){ b=a.Value;} 阅读全文
posted @ 2011-12-03 09:51 MXi4oyu 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 发送方:/* * File: main.c* Author: tianshuai** Created on 2011年11月29日, 下午10:34** 主要实现:发送20个文本消息,然后再发送一个终止消息*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>int port=67 阅读全文
posted @ 2011-11-30 15:33 MXi4oyu 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 本文主要是,简单实现tcp连接的两个程序。本文编写,假设读者有socket 编程思想。熟悉C编程。服务端:#include <stdio.h>#include <stdlib.h>#include <sys/socket.h>#include <netinet/in.h> //互联网地址族#include <arpa/inet.h>#include <netdb.h>#include <ctype.h> //toupper (小写转化为大写)int port =8000;/*服务端*/int main(int 阅读全文
posted @ 2011-11-30 15:32 MXi4oyu 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 70 下一页