惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
有赞技术团队
有赞技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Threat Research - Cisco Blogs
L
LangChain Blog
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
Latest news
Latest news
S
Schneier on Security
Cisco Talos Blog
Cisco Talos Blog
MyScale Blog
MyScale Blog
C
Check Point Blog
IT之家
IT之家
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
G
Google Developers Blog
T
Tor Project blog
T
Threatpost
D
DataBreaches.Net
博客园 - 【当耐特】
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Troy Hunt's Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
NISL@THU
NISL@THU
P
Privacy & Cybersecurity Law Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
博客园_首页
S
Securelist
T
The Exploit Database - CXSecurity.com
Last Week in AI
Last Week in AI
量子位
U
Unit 42
Know Your Adversary
Know Your Adversary
Hugging Face - Blog
Hugging Face - Blog
S
Security Affairs
Google Online Security Blog
Google Online Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志

博客园 - 群

DataGridView调整列宽及using()的用法 COM 对象与其基础 RCW 分开后就不能再使用 终于解决了一个问题--如何在数据绑定时不让combox控件触发SelectedIndexChanged事件 如何在winform中子窗体提交数据后刷新父窗体中的DataGRIDVIEW数据? 关于在.net中 预览上传控件中路径的图片 的方法 在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)[转] 获取新插入的数据的自增ID 漂浮窗体的实现 触发器不能读『转』 Server.MapPath介绍 Server.MapPath介绍 .NET里面取2个时间相差的天数 在static方法中调用非静态方法? label分页 使用回车代替Tab键的功能代码 绘图(包括绘坐标,图片) 很不错的传值 设置ComboBox默认 动态生成图片热点
取得当前日期所在的星期里从星期一到星期日所有的日期列表
· 2007-12-03 · via 博客园 - 群

Snowdust(雪尘)回复于 2006-01-13 09:35:34 得分 30

如果星期天是一周的第一天:  
  private   void   button1_Click(object   sender,   System.EventArgs   e)  
  {  
  DateTime   dt   =   DateTime.Now.AddDays(-   (int)DateTime.Now.DayOfWeek);  
  for(int   i   =   0;   i   <   7;   i++)  
  {  
  this.textBox1.Text   +=   "\r\n"   +   dt.AddDays(i).ToString("yyyy-MM-dd");  
  }  
  }  
  如果星期天是一周的最后一天:  
  private   void   button2_Click(object   sender,   System.EventArgs   e)  
  {  
  DateTime   dt;  
  if(DateTime.Now.DayOfWeek   ==   0)  
  {  
  dt   =   DateTime.Now.AddDays(   -   6);  
  }  
  else  
  {  
  dt   =   DateTime.Now.AddDays(1   -   (int)DateTime.Now.DayOfWeek);  
  }  
  for(int   i   =   0;   i   <   7;   i++)  
  {  
  this.textBox1.Text   +=   "\r\n"   +   dt.AddDays(i).ToString("yyyy-MM-dd");  
  }  
  }

我在做人才网的时候,要求列出本周星期一到星期七的日期,用到此方法.