Activation URLs

本文详细介绍了.NET远程对象激活中的两种URL类型:服务器激活对象URL(即众所周知的对象URL)和客户端激活对象URL,并解释了它们的格式及使用场景。文章还提到了在不同主机环境中配置远程类型的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Activation URLs

Server-activated objects that are published at a URL outside the application domain are called well-known types. Therefore, the URL is called the well-known object URL. The form of a well-known object URL is as follows:

ProtocolScheme://ComputerName:Port/PossibleApplicationName/ObjectUri

However, it is important to note that if you are hosting your remote object in Internet Information Services (IIS), you cannot declare an application name. In this case, the virtual directory of your application automatically becomes the application name. In addition, other minor changes might be required.

Client-activated objects do not need a unique URL for each object, because the .NET remoting system generates a URL that is unique to each instance on your behalf. As a result, the URL used to activate a client-activated object is called a client activation URL. The form of a client activation URL is as follows:

ProtocolScheme://ComputerName:Port/PossibleApplicationName

If you use TcpChannel objects, the port number is required.

With host application domains other than IIS, you can configure your remotable type programmatically or you can use a configuration file. To do the latter, you must load the values in the file by calling RemotingConfiguration.Configure and passing the name of the configuration file. (When you host a remotable type in Internet Information Services (IIS), <service> elements will be detected.) Although you can use any file name for your remoting configuration file, application security settings are only enforced if they are contained in a file that has a name in the following form:

<ApplicationName>.<FileExtension>.config

It is recommended that you use this file name form in most cases. For example, if your host executable is MyServer.exe, then the appropriate name for your configuration file is MyServer.exe.config.

Whatever file names you choose, you can pass several configuration files to Configure. It is often helpful to specify channels, formatters, and providers of custom channels in a separate file or files and then register them all in successive calls to Configure. This enables you to copy configuration files that deal only with channels, or providers, or any other custom functionality. If you specify custom channel templates in a Channels.config file and custom providers in a Providers.config file, you can use the calls shown in the following code example to configure your remoting client.

[C#]
RemotingConfiguration.Configure("Providers.config");
RemotingConfiguration.Configure("Channels.config");
RemotingConfiguration.Configure("RemoteClient.exe.config");

转载于:https://www.cnblogs.com/MayGarden/archive/2010/01/04/1638963.html

# Check massgrave.dev for more details write-host Write-Host "The current command (irm https://massgrave.dev/get | iex) will be retired in the future." Write-Host -ForegroundColor Green "Use the new command (irm https://get.activated.win | iex) moving forward." write-host if ($ExecutionContext.SessionState.LanguageMode.value__ -ne 0) { $ExecutionContext.SessionState.LanguageMode Write-Host "Windows PowerShell is not running in Full Language Mode." Write-Host "Help - https://massgrave.dev/fix_powershell" -ForegroundColor White -BackgroundColor Blue return } function Check3rdAV { $avList = Get-CimInstance -Namespace root\SecurityCenter2 -Class AntiVirusProduct | Where-Object { $_.displayName -notlike '*windows*' } | Select-Object -ExpandProperty displayName if ($avList) { Write-Host '3rd party Antivirus might be blocking the script - ' -ForegroundColor White -BackgroundColor Blue -NoNewline Write-Host " $($avList -join ', ')" -ForegroundColor DarkRed -BackgroundColor White } } function CheckFile { param ([string]$FilePath) if (-not (Test-Path $FilePath)) { Check3rdAV Write-Host "Failed to create MAS file in temp folder, aborting!" Write-Host "Help - https://massgrave.dev/troubleshoot" -ForegroundColor White -BackgroundColor Blue throw } } [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $URLs = @( 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/60c99742ce9ff1c675c6e381e17b0f4ccf1a57bd/MAS/All-In-One-Version-KL/MAS_AIO.cmd', 'https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?path=/MAS/All-In-One-Version-KL/MAS_AIO.cmd&versionType=Commit&version=60c99742ce9ff1c675c6e381e17b0f4ccf1a57bd', 'https://git.activated.win/massgrave/Microsoft-Activation-Scripts/raw/commit/60c99742ce9ff1c675c6e381e17b0f4ccf1a57bd/MAS/All-In-One-Version-KL/MAS_AIO.
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值