首页
学习
活动
专区
工具
TVP
发布

css小迷妹

专栏作者
166
文章
186235
阅读量
23
订阅数
一个汉字转拼音的C#类
using System; using System.Text.RegularExpressions; using System.Text; namespace Ming { public class PinYinHelper { private static int[] pyValue = new int[] { -20319,-20317,-20304,-20295,-20292,-20283,-20265,-20257,-20
用户7705674
2021-11-03
5420
C#编写的IP摄像头代码
#region IP摄像头代码 /// <summary> /// ip摄像头代码 /// </summary> //视频 private IntPtr m_hChannel; private IntPtr m_hServer, phPlay; public delegate void MyInvoke(string str); public delegate void OutDelegate(IntPtr hSearch, DVSNET_F
用户7705674
2021-11-03
8380
C#创建缩略图的操作类代码
这个C#类可以生成各种形式的缩略图,可以自动保持图片比例缩略,可以根据百分比获得图片尺寸等
用户7705674
2021-11-03
2580
C# 实现ping功能
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { System.Net.NetworkInformation.Ping
用户7705674
2021-11-03
7380
C# List<T>进行多字段排序
//调用方法 IList<class> List = new List<class>(); //排序字段 string[] property = new string[] { "column1","column2" }; //对应排序字段的排序方式 bool[] sort =new bool[]{ false,false }; //对 List 排序 List = new IListSort<class>(List, property,sort).Sort(); using System; using Sy
用户7705674
2021-11-03
1.1K0
C#判断远程计算机的指定端口是否打开
using System.Net; if(!string.IsNullOrEmpty(txtPort.Text)) { IPAddress ip = IPAddress.Parse(txtIp.Text); IPEndPoint point=new IPEndPoint(ip,int.Parse(txtPort.Text)); try { TcpClient tcp=new TcpClient(); tcp.Connect(point);
用户7705674
2021-11-03
1.1K0
C#通过FtpWebResponse 编写GUI 简易 FTP客户端
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Windows.Forms; using System.Net; using System.IO; class FtpClientForm : Form { public FtpClientForm() { Initializ
用户7705674
2021-11-03
8040
C# socket通信实现两个控制台之间聊天
1、运行效果 📷 图1 启动服务端 📷 图2 启动客户端 📷 图3 客户发消息 📷 图4 服务端发消息 📷 图5 客户主动关闭,服务段打印异常详情 2、服务器端源码 服务端和客户端都要添加一下namespace: using System.Net; using System.Net.Sockets; using System.Threading; 源码:  class Program     {         private static string serverIP = "192.168.3.42";
用户7705674
2021-11-03
7630
C#编写 HTML生成PDF
<body>     <div style="text-align:center;">     <iframe id="pdframe" width="900px;" height="850px;" name="pdframe" src="../dl/NOQRS.htm"             frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes">     </iframe>     </div>     <br />     <table border="0" align="center" cellpadding="0" cellspacing="0" class="wd noprint">         <tr>             <td align="right" height="30">             </td>         </tr>         <tr>             <td align="right" height="50">                 <a id="dc_a" class="dc" href="javascrpit:void(0)" target="_blank">                     <img src="../../images/dc.jpg" border="0" width="128" height="43" /></a> <a id="dy_a"                         class="dy" href="javascrpit:void(0)" onclick="dyqrs()">                         <img src="../../images/dy.jpg" border="0" width="128" height="43" /></a>             </td>         </tr>     </table> </body>
用户7705674
2021-11-03
1.4K0
C# 发HTTP请求
protected void btnSend_Click(object sender, EventArgs e) { string url = "http://localhost:3547/waplocation.aspx"; string mobileNo = this.txtMobileNo.Text; StringBuilder reqStr = new StringBuilder(100);
用户7705674
2021-11-03
4680
实现支持断点续传多线程下载的 Http Web 客户端C#工具类
/* .Net/C#: 实现支持断点续传多线程下载的 Http Web 客户端工具类 (C# DIY HttpWebClient) 2005-03-14 修订: /* .Net/C#: 实现支持断点续传多线程下载的工具类 Reflector 了一下 System.Net.WebClient ,改写或增加了若干: DownLoad、Upload 相关方法! 增加了 DataReceive、ExceptionOccurrs 事件 */ namespace Microshaoft.Utils { usi
用户7705674
2021-11-02
1.1K0
使用Lucene.net创建索引,实现搜索的C#代码示例
这段例子代码用的Lucene.Net2.9.2版本。现在最新版本是Lucene.Net3.0;Lucene.Net可以使用NuGet的安装得到
用户7705674
2021-11-02
9050
[C#]横竖都是4九宫格算法
群里的网友抛出了这样一道题 📷 我的算法: static void Main(string[] args) { /* * a + b - 9 = 4 * + - - * c - d * e =4 * / * - * f + g - h=4 * || || || * 4 4 4 * */ int flag = 50; for(int a=0;a<14; a++) //a {
用户7705674
2021-11-02
6090
asp.net下载文件几种方式
{ /* 微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite 下载超过400mb的文件时导致Aspnet_wp.exe进程回收而无法成功下载的问题。 代码如下: */ Response.ContentType = "application/x-zip-compressed"; Response.AddHeader("Content-Disposition", "attachment;filename=z.zip"); string filename = Server.MapPath("DownLoad/aaa.zip"); Response.TransmitFile(filename); } //WriteFile实现下载 protected void Button2_Click(object sender, EventArgs e) { /* using System.IO; */ string fileName ="aaa.zip";//客户端保存的文件名 string filePath=Server.MapPath("DownLoad/aaa.zip");//路径 FileInfo fileInfo = new FileInfo(filePath); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); Response.AddHeader("Content-Length", fileInfo.Length.ToString()); Response.AddHeader("Content-Transfer-Encoding", "binary"); Response.ContentType = "application/octet-stream"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312"); Response.WriteFile(fileInfo.FullName); Response.Flush(); Response.End(); } //WriteFile分块下载 protected void Button3_Click(object sender, EventArgs e) { string fileName = "aaa.zip";//客户端保存的文件名 string filePath = Server.MapPath("DownLoad/aaa.zip");//路径 System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath); if (fileInfo.Exists == true) { const long ChunkSize = 102400;//100K 每次读取文件,只读取100K,这样可以缓解服务器的压力 byte[] buffer = new byte[ChunkSize]; Response.Clear(); System.IO.FileStream iStream = System.IO.File.OpenRead(filePath); long dataLengthToRead = iStream.Length;//获取下载的文件总大小 Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fileName)); while (dataLengthToRead > 0 && Response.IsClientConnected) { int lengthRead = iStream.Read(buffer, 0, Convert.ToInt32(ChunkSize));//读取的大小 Response.OutputStream.Write(buffer, 0, lengthRead); Response.Flush(); dataLengthToRead = dataLengthToRead - lengthRead; } Response.Close(); } } //流方式下载 protected void Button4_Click(object sender, Eve
用户7705674
2021-11-02
1.8K0
C#二分查找算法演示代码
// input array is assumed to be sorted public int BinarySearch(int[] arr, int x) { if (arr.Length == 0) return -1; int mid = arr.Length / 2; if (arr[mid] == x) return mid; if (x < arr[mid]) return BinarySearch(GetSubArray(arr, 0, mid
用户7705674
2021-11-02
3450
C#操作系统进程的代码演示
这段代码演示了如何根据进程名关闭进程和启动进程 private bool CloseProcess(string CloseProcessName) { try { //根据进程名称,获取该进程信息 Process[] MyProcessS = Process.GetProcessesByName(CloseProcessName); foreach (P
用户7705674
2021-11-02
3560
C# 判断指定URL地址是否可以正常访问
C# 判断指定URL地址是否可以正常访问 如果只是判断url是否存在,不需要抓取整个url,只需要通过head方式请求即可
用户7705674
2021-11-02
2.8K0
C#分页显示服务器上指定目录下的所有图片代码
分页显示服务器上指定目录下的所有图片代码 <%@ Page Language="C#" EnableViewState="false" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <script runat="server"> String folder = "~/";// 网站根目录下的所有图像
用户7705674
2021-11-02
1.3K0
C# 获取内存和CPU信息的代码
获取cpu信息 using System.Collections; using System.Collections.Generic; using System.Management; using System.Text; namespace MergeSystem.Indexus.WinServiceCommon.SystemManagement { /// <summary> /// Represents the CPU scope information /// </summ
用户7705674
2021-11-02
2.3K0
C#数字转换成大写人民币金额
C#数字转换成大写人民币金额 如200转换成贰佰元 // 数字转换成大写金额 // 例如:(new Money(200)).ToString() == "贰佰元" namespace Skyiv.Util { using System.Text; class Test { static void Main() { for (;;) { System.Console.Write("金额: "); string s = Sys
用户7705674
2021-11-02
1K0
点击加载更多
社区活动
Python精品学习库
代码在线跑,知识轻松学
【玩转EdgeOne】征文进行中
限时免费体验,发文即有奖~
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·干货材料·成员作品·最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档