文章分类 -  c#

摘要:private string posturl="http://www.chinavb.net/post.aspx"; public static string PostData(string pType, string pInfo) { WebClient wc = new WebClient(); wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); byte[] postData = Encoding.ASCII.GetBytes("a= 阅读全文
posted @ 2011-04-27 13:44 邪灵 阅读(230) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/jianglai11/articles/1708330.html 阅读全文
posted @ 2011-04-25 17:38 邪灵 阅读(93) 评论(0) 推荐(0)
摘要:刚到公司混的时候,老板要求实现一个从C#的windows应用程序传参数到一个网页,然后这个网页不显示出来,但能把数据返回给应用程序的功能,问了好多人,找了好多资料,都搞不定,后来还是在老板的帮助下搞定的......,现在把方法写出来供大家参考。 ­ 其原理是,利用winfrom模拟表单提交数据,将要提交的参数提交给网页,网页执行代码,得到数据,然后Winform程序将网页的所有源代码读取下来,这样就达到windows应用程序和web应用程序之间传参和现实数据的效果了。 ­首先创建一个windows应用程序和web应用程序。 ­在web应用程序中,将网页切换到源代码 阅读全文
posted @ 2011-04-22 15:38 邪灵 阅读(2471) 评论(1) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication3{ class Program { static void Main(string[] args) { string username; username = Console.ReadLine(); Console.WriteLine("welcome {0}!",username); Console.ReadKey(); } }} 阅读全文
posted @ 2011-04-22 12:45 邪灵 阅读(78) 评论(0) 推荐(0)
摘要:"c:\\temp\\mydir\\my.doc"可以写成@"c:\temp\mydir\my.doc" 阅读全文
posted @ 2011-04-22 12:31 邪灵 阅读(655) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication3{ class Program { static void Main(string[] args) { int myinteger; string mystring; myinteger = 17; mystring = "\"myinteger\" is"; Console.WriteLine("{0} {1}." 阅读全文
posted @ 2011-04-22 12:18 邪灵 阅读(127) 评论(0) 推荐(0)
摘要:在调试应用程序 最好使用Console.ReadKey();方便看出调试结果 阅读全文
posted @ 2011-04-22 11:21 邪灵 阅读(283) 评论(0) 推荐(0)
摘要:一直没时间学习c# 看见很多东西都不明白!一头雾水 决心 从头看一边 Csharp 入门经典!只看不操作是没有效果的的, 只能边看变操作using System;class test{ static void Main() { Console.WriteLine("start!"); //Console. }} 阅读全文
posted @ 2011-04-21 14:46 邪灵 阅读(951) 评论(0) 推荐(0)