小编Dot*_*Dot的帖子

Go语言中的>>含义是什么?

我正在寻找有关Google Go语言的信息.在"A Tour of Go"中他们有这样的代码:

const (
    Big = 1<<100
    Small = Big>>99
)
Run Code Online (Sandbox Code Playgroud)

但是做什么<<>> 意味着什么?

您可以在http://tour.golang.org/#14上查看所有代码

programming-languages bit-shift go bitwise-operators

13
推荐指数
3
解决办法
6110
查看次数

如何在Autofac中注册这些类

我使用autofac作为Ioc容器.我有三个课程:

class Service
{
     public Service(Repository rep,UnitOfWork context){}

}

Class Repository
{
     public Repository(UnitOfWork context){}
}

class UnitOfWork{}
Run Code Online (Sandbox Code Playgroud)

Service and Repository需要UnitOfWork的相同实例

怎么做?以及如何在XmlConfiguration中创建它

c# dependency-injection ioc-container autofac

11
推荐指数
1
解决办法
3万
查看次数

创建Asp.net MVC 3应用程序时,我找不到关于UrlRoutingModule的<modules>

我已经下载了MVC 3的源代码,以了解它是如何运行的.

许多人说MVC拦截了UrlRouting Moudle Class的Http请求.

我知道当你定制一个HttpModule时,你需要像这样注册它:

<system.webServer>
    <modules>
      <add name="test" type="WebApplication2.MyModule1,WebApplication2"/>
    </modules>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)

所以Asp.net mvc应用程序的Web.config文件应该有配置部分:

 <add name="UrlRoutingModule"
           type="System.Web.Routing.UrlRoutingModule,..." />
Run Code Online (Sandbox Code Playgroud)

但是当我创建一个新的Asp.net MVC应用程序时,我无法在web.config文件中找到它.

有人说IIS 7会自动添加它.

什么时候到IIS7添加配置部分?

IIS7如何区别它是MVC应用程序还是WebForm?

asp.net-mvc web-config httpmodule

6
推荐指数
1
解决办法
2482
查看次数

为什么这是错的?(C#Task ContinueWith)

当我写下面的代码时:

 Task<string> task = Task.Factory.StartNew<string>(() => "first task")
         .ContinueWith(t =>
                 {
                     Console.WriteLine(t.Result);
                     Console.WriteLine("second task");
                 });
Run Code Online (Sandbox Code Playgroud)

那是错的!

然后我把它改成这个:

 var  task = Task.Factory.StartNew<string>(() => "first task")
         .ContinueWith(t =>
                 {
                     Console.WriteLine(t.Result);
                     Console.WriteLine("second task");
                 });
Run Code Online (Sandbox Code Playgroud)

一切都好!

为什么?

"任务任务"和"var任务"之间有什么不同?

c# multithreading task

1
推荐指数
1
解决办法
1079
查看次数

为什么P/Invoke函数必须在C#中是静态的?

看代码:

class VirtualMemoryManager
{
    [DllImport("kernel32.dll",EntryPoint="GetCurrentProcess")]
    internal static extern IntPtr GetCurrentProcessHandle();
}
Run Code Online (Sandbox Code Playgroud)

为什么"GetCurrentProcessHandle"必须"静态"

c#

-1
推荐指数
1
解决办法
271
查看次数