2008年6月25日

今天调试程序,发现了这个问题: Cannot update the cursor talbeName, since it is read-on,原因是没有tableName没有IIS账号下的读写权限。修改之后就可以了!

posted @ 2008-06-25 16:19 Leon916 阅读(7) | 评论 (0)编辑

2008年5月8日

http://wgmcn.com/blog/install-mplayer-and-w32codecs-on-ubuntu.html

posted @ 2008-05-08 19:24 Leon916 阅读(7) | 评论 (0)编辑

2008年5月5日

jillzhang的博客上看到了Nhibernate学习之起步篇-1,于是按照他的步骤把整个程序写了一遍,但是就是不能在数据库中建表:通过单步调试和跟踪NHibernate中的源代码,结果发现是XML文件没有配置正确,应该是生成操作中选择:嵌入的资源

不过通过跟踪NHibernate的源代码,对这个工具也算有了一点点了解了。

posted @ 2008-05-05 20:50 Leon916 阅读(16) | 评论 (0)编辑

2008年4月8日

 insert into openrowset('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:\','select * from TableName.dbf')select * from TableName

以上这句话是SQL Server 导出到DBF 中的,其重要注意的是TableName.dbf没有[]。

比如
insert into openrowset
('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:\',
'select * from ZYSS')
select * from ZYSS

posted @ 2008-04-08 22:39 Leon916 阅读(16) | 评论 (0)编辑

2008年3月30日

今天在书看到了一道题,大致内容是:9个台阶,从1到9,一次可以上一个或者两个台阶,不能大于2个,问有多少种不同的方法可以从1上到第9个台阶。

要求编程实现,证明或者说明你的方法是正确的。


我想了一个办法是直接用排列组合求解,可是答案更牛B,用斐波拉契数列。哎,看到了差距,用数列做其实很简单,而且这个数列也是计算机中最常见的。

posted @ 2008-03-30 12:51 Leon916 阅读(67) | 评论 (2)编辑

2008年3月29日

第一个:建表。注意列名字的长度,而且类型需要具体看帮助,比如char应该写成C。
第二个:SQL语句的参数,应该用?表示。具体见:http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=631326&SiteID=1

posted @ 2008-03-29 13:37 Leon916 阅读(16) | 评论 (0)编辑

2008年3月18日

今天调试一个程序,发现点击button要么没有反应,要么就是页面出错,错误的根源在与<input type = 'file'/>中,因为要传送的文件太大而导致的,通过在system.web下修改,添加<httpRuntime maxRequestLength="4096" executionTimeout="120"/> 参数自己设置。

posted @ 2008-03-18 17:11 Leon916 阅读(14) | 评论 (0)编辑

2008年1月26日

寒假开始了,在这个寒假中要学习的东西很多,今天开始学习Spring.Net和SOA,看了一些概念:AOP和依赖注入,不过还需要加深。 这篇文章讲的是注入:http://martinfowler.com/articles/injection.html,可以看看

posted @ 2008-01-26 20:13 Leon916 阅读(13) | 评论 (0)编辑

2008年1月23日

在c#中,给函数传递参数类型不同,其中基本类型和struct类型是值传递,而Class类型是引用传递,也就是当在函数中改变了基本类型和Struct类型中的值,返回后函数变量相应的值是不同,而Class类型在返回之后,其中的变量发生了变化。

posted @ 2008-01-23 14:33 Leon916 阅读(82) | 评论 (0)编辑

2008年1月13日

用JS,代码如下:
 function btn_click (a, b)
        {
                var xmlObj = new ActiveXObject("Msxml2.DOMDocument") ;
                var sXml  = "<?xml version=\"1.0\" ?>" ;
                      sXml += "<soap:Envelope "
                      sXml += "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " ;
                      sXml += "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " ;
                      sXml += "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" ;
                      sXml += "<soap:Body>" ;
                      sXml += "<Add xmlns=\"http://tempuri.org/\">" ;
                      sXml = sXml + "<a>" + a.value  + "</a>" ;
                      sXml = sXml + "<b>" + b.value  + "</b>" ;                     
                      sXml += "</Add></soap:Body></soap:Envelope>"
               
                xmlObj.loadXML(sXml) ;
               
                XmlRequest.innerText =  xmlObj.xml  ;
               
                var xmlHTTP = new ActiveXObject("Msxml2.XMLHTTP") ;
                xmlHTTP.Open ( "Post", "http://localhost/WebService/MyWebService.asmx", false) ;
                xmlHTTP.setRequestHeader("SOAPAction", "http://tempuri.org/Add") ;
                xmlHTTP.setRequestHeader("Content-Type", "text/xml; charset=utf-8" ) ;
                xmlHTTP.Send(xmlObj.xml) ;
                MyResult.innerText =  xmlHTTP.responseText ;
               
                var xmlResponse = xmlHTTP.responseXML ;
                answer.innerText = xmlResponse.selectSingleNode("soap:Envelope/soap:Body/AddResponse/AddResult").text ;
        }

</script>


<form>
        <p>Please input a:<input id="a" name="a"></input></p>
        <p>Please input b:<input id="b" name="b"></input></p>
        <p>
        <input type="button" id="btn"  value="Enter"
                onclick="jscript:btn_click(a, b)"></input>
        </p>
        <p>Answer is <span id="answer"></span></p>
        <hr></hr>
        <p>Request:</p>
        <span id="XmlRequest"></span>
        <p>Response:</p>       
        <span id="MyResult"></span>
       
</form>

</body>
</html>

用c#程序调用:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Xml;
using Microsoft.Web.Services3.Messaging;
using Microsoft.Web.Services3;
namespace SOAP
{
    class MathClient : SoapClient
    {
        public MathClient(Uri destination) : base(destination)
            //: base(destination)
        {
        }

        private SoapEnvelope CreateMessage(string op, int a, int b)
        {
            SoapEnvelope envelope = new SoapEnvelope();
            envelope.CreateBody();
            envelope.Body.InnerXml = string.Format(
                @"<{0} xmlns = 'http://tempuri.org/'>
                    <a>{1}</a>
                    <b>{2}</b>
                </{0}>", op, a, b);
            return envelope;
        }

        [SoapMethod("http://tempuri.org/Add")]
        public int Add(int a, int b)
        {
            try
            {
                SoapEnvelope sendEnvelope = CreateMessage("Add", a, b);

                SoapEnvelope receiveEnvelope = base.SendRequestResponse("Add", sendEnvelope);
                int x = XmlConvert.ToInt32(receiveEnvelope.InnerText);
                return x;
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
                return -1;
            }
        }
    }
}
 class Program
    {
        static void Main(string[] args)
        {
            MathClient mathiClient = new MathClient(new Uri("http://localhost/WebService/MyWebService.asmx"));
            int a = mathiClient.Add(2, 10);
            Console.WriteLine(a);
        }
    }

posted @ 2008-01-13 20:44 Leon916 阅读(16) | 评论 (0)编辑