pocketwit
这个项目主要是发布微博客的工具,但是其操作界面很不错,值得学习
如果你关注windows mobile的开发,这是一个不可多得的好项目

搜索结果 标签: .Net


稍微看了下,以下几点不错
一、有个微软的web平台蛮好的,http://www.microsoft.com/web/downloads/platform.aspx
其中集成了IIS, SQL Server Express, .NET Framework 和 Visual Web Developer。
对asp.net和php的支持良好,你也不妨下过来试试。
二、比较多的开源项目集成:http://www.microsoft.com/web/gallery/Default.aspx
看到了几个熟悉的项目:wordpress,drupal,BlogEngine.NET,这些都是不错的项目,不论是使用,还是学习
三、还看到了一些开发工具、等等
看到上面几点,可能还有其他东西,看来微软对开源还是有点动作的,期待更大点……
在c#中调用rapi来完成windows ce的文件操作。
详细参见:http://blog.csdn.net/jarvisj/archive/2005/06/05/387902.aspx
详细api文档(msdn英文):http://msdn.microsoft.com/en-us/library/aa458022.aspx
但是如果用 CeRapiInit来判断链接有一个问题:这个函数的运行过程是开始判断是否连接了设备,如果没有设备,这个进程将一直挂着,直到插上了设备才继续执行,这样就不能马上给出判断,所以可以采用CeRapiInitEx函数。
CeRapiInit和CeRapiInitEx的区别:前者是将进程一直挂着,等待设备的插入,而后者是即刻判断。
主要讲解CeRapiInitEx的使用:
//接口声明
[DllImport("rapi.dll")]
public static extern void CeRapiInitEx(ref RAPIINIT pRapiInit);//自定义返回类型结构
[StructLayout(LayoutKind.Sequential)]
public struct RAPIINIT
{
public int cbsize;
public IntPtr heRapiInit;
public UInt32 hrRapiInit;
};//函数使用
RAPIINIT r = new RAPIINIT();
r.cbsize = Marshal.SizeOf(r);
CeRapiInitEx(ref r);
//r.hrRapiInit==0 判断连接成功
在vs的命令行模式下键入 aspnet_regiis -pef “connectionStrings” “/dir” -prov “RSAProtectedConfigurationProvider”
说 明:-pef 指加密web.config区块 ”/dir” 指web应用程序的虚拟目录 -prov 指选择哪种加密方式 如(RSAProtectedConfigurationProvider、 DataProtectionConfigurationProvider)
用-pdf 相反于-pef的解密模式
这种加密我换了台计算机就无法解密了,不知道安全性如何,但是起码比明文好。

链接字符串:
“Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=XXX.XXX.XXX.XXX;Initial Catalog=MyCtlg;Package Collection =MyPkgCol;Default Schema=Schema;User ID=MyUser;Password=MyPW”
“Provider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC Remote LU Alias =MyRemote;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;UserID=MyUser;Password=MyPW”
译自:http://blog.madskristensen.dk/post/Ping-using-XML-RPC-in-ASPNET.aspx
很多Blog已经具备了Ping功能,当内容发生被创建或修改的时候,就会Ping不同的Ping服务,例如 Ping-o-Matic, Feedburner 和Technorati。但并不只是博客才能受惠这个Ping服务,所有的网站都可以用这个技术来定期发布它们的更新情况。
所有的这些服务都可以使用XML-RPC或它的拓展形式,因此你可以写一个Ping类,仅仅是用来添加Ping服务的URL。我已经写了一个可以使用到ASP.NET应用程序中的简单静态Ping类。
Here is the the three methods needed to send XML-RPC pings.
有3个方法发送XML-RPC Ping
/// <summary>
/// Sends a ping to various ping services.
/// </summary>
public static void Send()
{
Execute(“http://ping.feedburner.com”);
Execute(“http://rpc.pingomatic.com/RPC2″);
}
/// <summary>
/// Creates a web request and with the RPC-XML code in the stream.
/// </summary>
private static void Execute(string url)
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = “POST”;
request.ContentType = “text/xml”;
request.Timeout = 3000;
AddXmlToRequest(request);
request.GetResponse();
}
catch (Exception)
{
// Log the error.
}
}
/// <summary>
/// Adds the XML to web request. The XML is the standard
/// XML used by RPC-XML requests.
/// </summary>
private static void AddXmlToRequest(HttpWebRequest request)
{
Stream stream = (Stream)request.GetRequestStream();
using (XmlTextWriter writer = new XmlTextWriter(stream, Encoding.ASCII))
{
writer.WriteStartDocument();
writer.WriteStartElement(“methodCall”);
writer.WriteElementString(“methodName”, “weblogUpdates.ping”);
writer.WriteStartElement(“params”);
writer.WriteStartElement(“param”);
// Add the name of your website here
writer.WriteElementString(“value”, “The name of your website”);
writer.WriteEndElement();
writer.WriteStartElement(“param”);
// The absolute URL of your website – not the updated or new page
writer.WriteElementString(“value”, “http://www.example.com”);
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndElement();
}
}
下载下面这个类并把它放置在 App_Code 文件夹或一个类库里。在你ASP.NET工程的任何位置你都可以使用如下的形式来调用Send方法:
PingService.Send();
因为要ping 所有不同的服务,你可能会考虑用异步调用的形式来实现。如此实现。现在你有一个类,可以使用 XML-RPC pings 各种各样的服务了,你可以从这个列表里找ping 服务 .
译自:http://blog.madskristensen.dk/post/Tag-mapping-in-ASPNET.aspx
最近我开始在 ZYB 工作但并没有看所有的代码。有一天我看到了一个web.config的一个特殊的节点tagMapping。我之前从来没有见到过,直到问了我周围的同事。基本上,它是在编译的时候将所有的一种类型转换成另一种类型。在自然语言的意思是它能将你整个网站中的所有例如System.Web.UI.WebControls.Textbox 实例转换成另一个组件。
如此酷的作用,我来做一个简单的示例。我已经建了一个简单的组件,这个组件继承自TextBox并重写了Text属性,因此它能HTML编码text。我把它放置到App_Code文件夹下并命名为SafeTextBox。
public class SafeTextBox : System.Web.UI.WebControls.TextBox
{
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = System.Web.HttpUtility.HtmlEncode(value);
}
}
}
然后我需要在web.config中通过标签映射将所有的文本框和SafeTextBox实例关联起来。它能在整个网站中轻松的覆盖所有的TextBox实例。这个就是需要的Web.config配置:
<pages>
<tagMapping>
<add tagType=”System.Web.UI.WebControls.TextBox” mappedTagType=”SafeTextBox”/>
</tagMapping>
</pages>
这是一个聪明的方法将你自己的服务器组件应用到一个网站上去。 可惜的是直到最近我才知道有这种方法。
Enterprise Library
http://www.codeplex.com/entlib
http://msdn.microsoft.com/entlib/
Castle Windsor
http://www.castleproject.org/container/index.html
StructureMap
http://structuremap.sourceforge.net/
Spring.NET
http://www.springframework.net/
Ninject
http://kohari.org/projects/ninject/
NHibernate
http://www.hibernate.org/343.html
log4net
http://logging.apache.org/log4net/
Quartz.NET
Enterprise Job Scheduler for .NET Platform
http://quartznet.sourceforge.net/
我的Blog选用BlogEngine.NET 作为我的Blog,有以下几点优势: