类库文件我们在文件最后面下载
【ThoughtWorks.QRCode.dll 就是类库】
使用时需要增加: 代码如下:using ThoughtWorks.QRCode.Codec;
using ThoughtWorks.QRCode.Codec.Data;
using ThoughtWorks.QRCode.Codec.Util;主要源代码:
1.生成二维码代码如下:QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); String encoding = cboEncoding.Text; if (encoding == "Byte") { qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_...
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;namespace 计时器
{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){label1.Text = DateTime.Now.ToString();System.Timers.Timer t = new System.Ti...
C#微信小程序服务端获取用户解密信息实例代码
实现代码:
using AIOWeb.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web; namespace AIOWeb
{ /// <summary> /// wxapi 的摘要说明 /// </summary> public class wxapi : IHttpHandler { public void ProcessRequest(...
代码如下:#region 参数传递方法第一种 //参数设置方法(第一种)
//SqlParameter sp = new SqlParameter("@Name", str_Name);
//SqlParameter sp2 = new SqlParameter("@Pwd", str_Pwd);
//cmd.Parameters.Add(sp);
//cmd.Parameters.Add(sp2);
#endregion
//简单的一般使用第一种#region 参数传递的第二种方法(是第一种的省略传递变量)
cmd.Parameters.Add(new SqlParameter("@Name", str_Name));
...
代码如下:using System;using System.Collections.Generic;using System.Text;using System.Net.Mail;using System.Net;namespace MyQuery.Utils{ /// <summary> /// 封装邮件处理 /// by 贾世义 2011-6-3 /// </summary> public static class MailHelper { private static string smtpHost = null; private static int smptPort = 25; private static bool smtpIsUserCredentials = false...
1. C#实现Web文件的上传 使用C#如何实现文件上传的功能呢?下面笔者简要介绍一下。 首先,在你的Visual C# web project 中增加一个上传用的Web Form,为了要上传文件,需要在ToolBox中选择HTML类的File Field控件,将此控件加入到Web Form中,然而此时该控件还不是服务端控件,我们需要为它加上如下一段代码:<input id=PreviousFile1 type=file size=49 runat="server">,这样它就成为服务端控件了,如果需要同时上传数个文件时,我们...
前台代码:代码如下: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> li { list-style: none; padding-top: 10px; ...
代码如下:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text.RegularExpressions; using System.IO; using System.Text; using System.Data; namespace SJLERP { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Dictionary<string, string> cityA...
CREATE PROC P_TEST@Name VARCHAR(20), @Rowcount INT OUTPUT AS BEGIN SELECT * FROM T_Customer WHERE NAME=@Name SET @Rowcount=@@ROWCOUNT END GO ---------------------------------------------------------------------------------------- --存储过程调用如下: ---------------------------------------------------------------------------------------- DECLARE @i INT EXEC P_TEST 'A',@i OUTPUT SELECT @i --结果 /* ...
2.1首先创建一个最基本的web service服务端,顾名思义就是提供服务,这儿实现一个简单的加法计算。
首先,vs2013--文件---新建项目---Asp.net 空Web 应用程序 (VC# 下面的)
创建 名称 ServiceFuwuduan ----名字自己去就可以啦生成项目如图所示的解决方案和项目然后在项目上 点击右键 ---添加---新建项 弹出新窗口----找到Web服务(asms)生成的ServiceFuwu.asmx 代码如下:
using?System;
using?System.Collections.Gene...