public virtual void ReadFull(BinaryReader reader, NetVersion version) { string dataString = PyNet.DecompressString(reader.ReadString()); reader.ReadBoolean(); string replacementString = PyNet.DecompressString(reader.ReadString()); Dictionary <string, string> data = new Dictionary <string, string>(); foreach (string s in dataString.Split(SaveHandler.seperator)) { string[] d = s.Split(SaveHandler.valueSeperator); data.Add(d[0], d[1]); } object elementReplacement = Element.getReplacement(); SaveHandler.ReplaceAll(elementReplacement, elementReplacement); if (ReplacementSerializer == null) { ReplacementSerializer = new XmlSerializer(elementReplacement.GetType()); } StringReader replacementStringReader = new StringReader(replacementString); object replacement = ReplacementSerializer.Deserialize(replacementStringReader); SaveHandler.RebuildAll(replacement, replacement); Element.rebuild(data, replacement); }
internal void SetDefaults(string name) { Contract.Requires(name != null); fromExisting = false; isDLL = name.EndsWith(".dll") || name.EndsWith(".DLL"); if (isDLL) { characteristics = FileImage.dllCharacteristics; } else { characteristics = FileImage.exeCharacteristics; } lMajor = MetaData.LMajors[0]; lMinor = 0; fileAlign = FileImage.minFileAlign; osMajor = 4; osMinor = 0; userMajor = 0; userMinor = 0; subSysMajor = 4; subSysMinor = 0; subSystem = SubSystem.Windows_CUI; DLLFlags = FileImage.DLLFlags; cliMajVer = 2; cliMinVer = 0; corFlags = CorFlags.CF_IL_ONLY; mdMajVer = 1; mdMinVer = 1; // MetaData Minor Version ECMA = 0, PEFiles = 1 netVersion = NetVersion.Everett; netVerString = MetaData.versions[0]; tsMajVer = 1; tsMinVer = 0; }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { sourceRect = new NetRectangle(); if (sourceRect == null) { throw new Exception("WTF??? Why is netfield null"); } if (reader == null) { throw new Exception("reader null"); } if (value == null) { this.Set(new Animation()); } sourceRect.Read(reader, version); Value.sourceRectangle = sourceRect.Value; frameDuration = new NetInt(); frameDuration.Read(reader, version); Value.frameDuration = frameDuration.Value; frameDurationUntilNextAnimation = new NetInt(); frameDurationUntilNextAnimation.Read(reader, version); Value.frameCountUntilNextAnimation = frameDurationUntilNextAnimation.Value; }
/// <summary> /// Converts given framework version to csproj or vbproj file entry /// </summary> /// <param name="runtime">given runtime</param> /// <returns>framework string</returns> public string this[NetVersion runtime] { get { switch (runtime) { case NetVersion.Net2: return(" <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>"); case NetVersion.Net3: return(" <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>"); case NetVersion.Net35: return(" <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"); case NetVersion.Net4: return(" <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"); case NetVersion.Net4Client: return(" <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n <TargetFrameworkProfile>Client</TargetFrameworkProfile>"); case NetVersion.Net45: return(" <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>"); default: throw new ArgumentOutOfRangeException("runtime"); } } }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { NetString name = new NetString(); name.Read(reader, version); NetString iD = new NetString(); iD.Read(reader, version); StardustCore.ModCore.ModMonitor.Log("Name: " + name); StardustCore.ModCore.ModMonitor.Log("Mod ID:" + iD); //Texture2D texture = new Texture2D(Game1.graphics.GraphicsDevice,width,height); if (String.IsNullOrEmpty(iD.Value) || String.IsNullOrEmpty(name.Value)) { ModCore.ModMonitor.Log("FOR SOME REASON THE TEXTURE INFO IS NULL????"); return; } Texture2DExtended texture = ModCore.TextureManagers[iD.Value].getTexture(name.Value); if (texture == null) { throw new Exception("FOR SOME REASON NULL IS BEING READ???"); } this.Value = texture; }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { NetCoreObject obj = new NetCoreObject(); obj.Read(reader, version); //Values already taken care of in NetCoreObject NetList <KeyValuePair <Vector2, MultiTileComponent>, NetKeyValuePair <Vector2, MultiTileComponent, NetVector2, NetMultiTileComponent> > netList = new NetList <KeyValuePair <Vector2, MultiTileComponent>, NetKeyValuePair <Vector2, MultiTileComponent, NetVector2, NetMultiTileComponent> >(); netList.Read(reader, version); if (netList.ToList() == null) { throw new Exception("WTF WHY IS NETLIST NULL?!?!?!?!"); } foreach (var v in netList.ToList()) { StardustCore.ModCore.ModMonitor.Log(v.Value.name, StardewModdingAPI.LogLevel.Alert); } Value.objects = netList.ToList(); //this.value.objects=netList.ToArray().ToList(); NetColor col = new NetColor(); col.Read(reader, version); Value.categoryColor = col.Value; NetString name = new NetString(); name.Read(reader, version); Value.categoryName = name.Value; }
protected internal void CopyUsedNetOfficeAssembliesToTempTarget() { string[] officeApps = Options.OfficeApps; NetVersion runtime = Options.NetRuntime; List <string> apps = CreateValidatedReferenceList(officeApps); string assembliesFolderPath = Program.DependencySubFolder; string assembliesTempTarget = TempNetOfficePath; File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.xml"), Path.Combine(assembliesTempTarget, "NetOffice.xml")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.xml"), Path.Combine(assembliesTempTarget, item + "Api.xml")); } if (runtime == NetVersion.Net4 || runtime == NetVersion.Net4Client) { File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.dll"), Path.Combine(assembliesTempTarget, "NetOffice.dll")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.dll"), Path.Combine(assembliesTempTarget, item + "Api.dll")); } } else { string targetPackageName = null; switch (runtime) { case NetVersion.Net2: targetPackageName = Path.Combine(assembliesFolderPath, "2.0.zip"); break; case NetVersion.Net3: case NetVersion.Net35: targetPackageName = Path.Combine(assembliesFolderPath, "3.0.zip"); break; case NetVersion.Net45: targetPackageName = Path.Combine(assembliesFolderPath, "4.5.zip"); break; default: throw new ArgumentOutOfRangeException("runtime"); } using (ZipArchive zip = ZipFile.OpenRead(targetPackageName)) { var netOfficeEntry = zip.GetEntry("NetOffice.dll"); netOfficeEntry.ExtractToFile(Path.Combine(assembliesTempTarget, "NetOffice.dll"), true); foreach (var item in apps) { var libraryEntry = zip.GetEntry(item + "Api.dll"); libraryEntry.ExtractToFile(Path.Combine(assembliesTempTarget, item + "Api.dll"), true); } } } }
public SnapResult(HSUPA_CommonParam CommonParam) { //m_CommonParam = CommonParam; m_UserCollection = CommonParam.UserCol; m_NetVersion = NetVersion.UMTSHSUPA; //cellResult.CommonParam = m_CommonParam; //userResult.CommonParam = m_CommonParam; GeResults(CommonParam); }
public ThriftServiceInfo Init(string filePath, NetVersion netVersion) { var textThrift = File.ReadAllText(filePath); string dllName = string.Empty; if (NetVersion.Net45 == netVersion) { dllName = GetRegexGroup(textThrift, "^namespace csharp ([A-z_.]+)"); } else { dllName = GetRegexGroup(textThrift, "^namespace netcore ([A-z_.]+)"); } if (string.IsNullOrWhiteSpace(dllName)) { throw new ArgumentNullException($"namespace {NetVersion.Net45} is null"); } string thriftServiceClassName = GetRegexGroup(textThrift, "^service ([A-z_]+)"); string serviceName = GetRegexGroup(textThrift, "^# servicename=([A-z_]+)"); string host = GetRegexGroup(textThrift, "^# host=([0-9.]+)"); string portStr = GetRegexGroup(textThrift, "^# port=(\\d+)"); int.TryParse(portStr, out int port); bool isPush = false; var strPush = GetRegexGroup(textThrift, "^# nugetpush=(TRUE|true)"); if (strPush != null) { isPush = true; } string newPath = $"{Path.GetTempPath()}thrift\\{DateTime.Now.Ticks}"; if (!Directory.Exists(newPath)) { Directory.CreateDirectory(newPath); } var info = new ThriftServiceInfo() { WorkDir = newPath, ThriftFile = filePath, ThriftNamespaceName = dllName, ThriftServiceClassName = thriftServiceClassName, NetVersion = netVersion, ServiceName = serviceName, Host = host, Port = port, NugetPush = isPush }; return(info); }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { bool newValue = reader.ReadBoolean(); if (version.IsPriorityOver(ChangeVersion)) { setInterpolationTarget(newValue); } }
public ThriftGenerate(string filePath, NetVersion netVersion) { _resourcesDir = Util.GetExpansionToolResourcesPath(); //_thriftPath = "thrift.exe"; _thriftPath = GetEXEFilePath("thrift.exe"); _info = Init(filePath, netVersion); }
internal void SetVersionFromString() { for (int i = 0; i < MetaData.versions.Length; i++) { if (MetaData.versions[i].Trim(nulls) == netVerString) { netVersion = (NetVersion)i; netVerString = MetaData.versions[i]; } } }
public HSDPA_ResultManage(HSDPA_CommonParam commonParam) { m_CellList = commonParam.CellList; m_NotAccessUser = commonParam.UserCol.NotAccessedUser; m_AccessUser = commonParam.UserCol.AccessedUser; m_PreAccessUser = commonParam.UserCol.PreAccessedUser; m_Version = NetVersion.UMTSHSDPA; m_CellResultTable = new DataTable(ContextKeys.UMTS_HSDPACellResult); m_UserResultTable = new DataTable(ContextKeys.UMTS_HSDPAUserResult); m_AccessResultTable = new DataTable(ContextKeys.UMTS_HSDPA_AcessUser); }
public virtual void Read(BinaryReader reader, NetVersion version) { string dataString = PyNet.DecompressString(reader.ReadString()); Dictionary <string, string> data = new Dictionary <string, string>(); foreach (string s in dataString.Split(SaveHandler.seperator)) { string[] d = s.Split(SaveHandler.valueSeperator); data.Add(d[0], d[1]); } Element.sync(data); }
/// <summary> /// 创建应用程序池 /// </summary> /// <param name="appName">自定义引用程序池名</param> /// <param name="type">托管类型</param> /// <param name="netV">.net版本</param> /// <returns></returns> public DirectoryEntry CreatAppPool(string appName, ModelType type, NetVersion netV) { if (!IsAppPoolExist(appName)) { DirectoryEntry newpool; DirectoryEntry appPools = new DirectoryEntry("IIS://localhost/W3SVC/AppPools"); newpool = appPools.Children.Add(appName, "IIsApplicationPool"); //修改应用程序池配置 SetModalAndNetVersionOfappPool(appName, type, netV); newpool.CommitChanges(); return(newpool); } else { return(null); } }
public CeloAccountSignerTransactionManager(IClient rpcClient, Account account, BigInteger?chainId, string feeCurrency = null, string gatewayFeeRecipient = null, BigInteger?gatewayFee = null) { if (!chainId.HasValue) { NetVersion nv = new NetVersion(rpcClient); string version = nv.SendRequestAsync().GetAwaiter().GetResult(); ChainId = BigInteger.Parse(version); } else { ChainId = chainId.Value; } FeeCurrency = feeCurrency; GatewayFeeRecipient = gatewayFeeRecipient; GatewayFee = gatewayFee; Account = account ?? throw new ArgumentNullException(nameof(account)); Client = rpcClient; _transactionSigner = new CeloAccountOfflineTransactionSigner(); }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { texture = new NetTexture2DExtended(); texture.Read(reader, version); Value.setExtendedTexture(texture.Value); which = new NetInt(); which.Read(reader, version); Value.ParentSheetIndex = which.Value; tilePos = new NetVector2(); tilePos.Read(reader, version); Value.TileLocation = tilePos.Value; InventoryMaxSize = new NetInt(); InventoryMaxSize.Read(reader, version); Value.inventoryMaxSize = InventoryMaxSize.Value; sourceRect = new NetRectangle(); sourceRect.Read(reader, version); Value.sourceRect = sourceRect.Value; boundingBox = new NetRectangle(); boundingBox.Read(reader, version); Value.boundingBox.Value = boundingBox.Value; drawPosition = new NetVector2(); drawPosition.Read(reader, version); Value.drawPosition = drawPosition.Value; locationName = new NetString(); locationName.Read(reader, version); Value.locationsName = locationName.Value; Value.thisLocation = Game1.getLocationFromName(locationName.Value); /* * animationManager = new NetAnimationManager(); * animationManager.Read(reader, version); * Value.animationManager = animationManager.Value; */ }
/// <summary> /// Set the .NET version for this PE file /// </summary> /// <param name="nVer">.NET version</param> public void SetNetVersion(NetVersion nVer) { versionInfo.netVersion = nVer; versionInfo.netVerString = MetaData.versions[(int)versionInfo.netVersion]; if ((nVer == NetVersion.Whidbey40) || (nVer == NetVersion.Whidbey41)) { versionInfo.tsMinVer = 1; } else { versionInfo.tsMinVer = 0; } if (nVer == NetVersion.Whidbey50) { versionInfo.tsMajVer = 2; } GenericParam.extraField = nVer <= NetVersion.Whidbey40; if (Diag.DiagOn && GenericParam.extraField) { Console.WriteLine("Writing extra field for GenericParams"); } }
public CeloAccountSignerTransactionManager(IClient rpcClient, string privateKey, BigInteger?chainId, string feeCurrency = null, string gatewayFeeRecipient = null, BigInteger?gatewayFee = null) { if (!chainId.HasValue) { NetVersion nv = new NetVersion(rpcClient); string version = nv.SendRequestAsync().GetAwaiter().GetResult(); ChainId = BigInteger.Parse(version); } else { ChainId = chainId.Value; } FeeCurrency = feeCurrency; GatewayFeeRecipient = gatewayFeeRecipient; GatewayFee = gatewayFee; if (privateKey == null) { throw new ArgumentNullException(nameof(privateKey)); } Client = rpcClient; Account = new Account(privateKey); Account.NonceService = new InMemoryNonceService(Account.Address, rpcClient); _transactionSigner = new CeloAccountOfflineTransactionSigner(); }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { //Checks to see if the current animation is nothing, aka null. NetBool isNull = new NetBool(); isNull.Read(reader, version); bool valueIsNull = isNull.Value; if (isNull) { NetTexture2DExtended nullTexture = new NetTexture2DExtended(); nullTexture.Read(reader, version); NetAnimation nullAnimation = new NetAnimation(); nullAnimation.Read(reader, version); Value.setExtendedTexture(nullTexture.Value); Value.defaultDrawFrame = nullAnimation.Value; return; } NetString currentAnimationName = new NetString(); currentAnimationName.Read(reader, version); NetInt currentIndex = new NetInt(); currentIndex.Read(reader, version); NetTexture2DExtended text = new NetTexture2DExtended(); text.Read(reader, version); NetAnimation defaultAnimation = new NetAnimation(); defaultAnimation.Read(reader, version); NetBool enabled = new NetBool(); enabled.Read(reader, version); NetString data = new NetString(); data.Read(reader, version); Value.setExtendedTexture(text.Value); Value.defaultDrawFrame = defaultAnimation.Value; Value.enabled = enabled.Value; //Try and prevent unnecessary parsing. if (Value.animations == null && !String.IsNullOrEmpty(Value.animationDataString)) { Value.animations = Animations.AnimationManager.parseAnimationsFromXNB(data.Value); } if (!String.IsNullOrEmpty(data.Value)) { Value.setAnimation(currentAnimationName.Value, currentIndex.Value); } else { Value.currentAnimation = defaultDrawFrame.Value; } }
/// <summary> /// Set the .NET version for this PE file /// </summary> /// <param name="nVer">.NET version</param> public void SetNetVersion(NetVersion nVer) { versionInfo.netVersion = nVer; versionInfo.netVerString = MetaData.versions [(int)versionInfo.netVersion]; if ((nVer == NetVersion.Whidbey40) || (nVer == NetVersion.Whidbey41)) { versionInfo.tsMinVer = 1; } else { versionInfo.tsMinVer = 0; } if (nVer == NetVersion.Whidbey50) { versionInfo.tsMajVer = 2; } GenericParam.extraField = nVer <= NetVersion.Whidbey40; if (Diag.DiagOn && GenericParam.extraField) Console.WriteLine("Writing extra field for GenericParams"); }
public async Task<dynamic> ExecuteTestAsync(RpcClient client) { var netVersion = new NetVersion(client); return await netVersion.SendRequestAsync(); }
public Net(RpcClient client) : base(client) { Listening = new NetListening(client); PeerCount = new NetPeerCount(client); Version = new NetVersion(client); }
private void SetNetVersionDisplay(bool isAveRes, DataRow row,NetVersion versionType) { if (isAveRes) { row[NETVERSION] = "Result"; } else { row[NETVERSION] = versionType.ToString(); } }
public async Task<object> ExecuteTestAsync(IClient client) { var netVersion = new NetVersion(client); return await netVersion.SendRequestAsync(); }
/// <summary> /// 创建网站 /// </summary> /// <param name="siteInfo"></param> /// <param name="type"></param> /// <param name="netV"></param> public DirectoryEntry CreatNewWeb(NewWebSiteInfo siteInfo, ModelType type = ModelType.集成, NetVersion netV = NetVersion.v4_0) { DirectoryEntry services = new DirectoryEntry("IIS://localhost/W3SVC"); int webId = 0; foreach (DirectoryEntry server in services.Children) { if (server.SchemaClassName == "IIsWebServer") { if (Convert.ToInt32(server.Name) > webId) { webId = Convert.ToInt32(server.Name); } } } webId++; //创建站点 DirectoryEntry mySitServer = services.Children.Add(webId.ToString(), "IIsWebServer"); mySitServer.Properties["ServerComment"].Clear(); mySitServer.Properties["ServerComment"].Add(siteInfo.WebName); mySitServer.Properties["Serverbindings"].Clear(); mySitServer.Properties["Serverbindings"].Add(":" + siteInfo.PorNum + ":"); mySitServer.Properties["path"].Clear(); //注意该path为站点的路径,新增站点时,两者目录一致 mySitServer.Properties["path"].Add(siteInfo.WebPath); mySitServer.Properties["DefaultDoc"].Add(siteInfo.DefaultPage); //设置默认文档 //创建虚拟目录 DirectoryEntry root = mySitServer.Children.Add("Root", "IIsWebVirtualDir"); root.Properties["path"].Clear();//该路劲属性是站点下虚拟路径的路径,类似于站点的子路径 root.Properties["path"].Add(siteInfo.VisualPath); if (string.IsNullOrEmpty(siteInfo.AppName)) { root.Invoke("appCreate", 0); } else { //创建引用程序池 string appPoolName = siteInfo.AppName; if (!IsAppPoolExist(appPoolName)) { DirectoryEntry newpool; DirectoryEntry appPools = new DirectoryEntry("IIS://localhost/W3SVC/AppPools"); newpool = appPools.Children.Add(appPoolName, "IIsApplicationPool"); newpool.CommitChanges(); } //修改应用程序池配置 SetModalAndNetVersionOfappPool(appPoolName, type, netV); root.Invoke("appCreate3", 0, appPoolName, true); } root.Properties["AppFriendlyName"].Clear(); root.Properties["AppIsolated"].Clear(); root.Properties["AccessFlags"].Clear(); root.Properties["FrontPageWeb"].Clear(); root.Properties["AppFriendlyName"].Add(root.Name); root.Properties["AppIsolated"].Add(2); root.Properties["AccessFlags"].Add(513); root.Properties["FrontPageWeb"].Add(1); root.CommitChanges(); mySitServer.CommitChanges(); return(mySitServer); }
/// <summary> /// 在DataTable里添加版本结果的DataRow /// </summary> /// <param name="versionType">版本类型</param> /// <param name="table">添加了DataRow的DataTable</param> private void GenerateNetVersionDataRow(SimuResultStruct resultToShow,DataTable table,NetVersion versionType,bool isAveRes) { DataRow row = table.NewRow(); SetNetVersionDisplay(isAveRes, row, versionType); Type simuResultType = typeof(SimuResultStruct); FieldInfo[] fields = simuResultType.GetFields(); foreach(var field in fields) { row[field.Name] = field.GetValue(resultToShow).ToString(); } SetNetVersionDisplay(isAveRes,row,versionType); table.Rows.Add(row); }
public void ReadData(BinaryReader reader, NetVersion version) { ReadDelta(reader, version); }
protected internal void CopyUsedNetOfficeAssembliesToTempTarget() { string[] officeApps = Options.OfficeApps; NetVersion runtime = Options.NetRuntime; List <string> apps = CreateValidatedReferenceList(officeApps); string assembliesFolderPath = Program.DependencySubFolder; string assembliesTempTarget = TempNetOfficePath; File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.xml"), Path.Combine(assembliesTempTarget, "NetOffice.xml")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.xml"), Path.Combine(assembliesTempTarget, item + "Api.xml")); } if (runtime == NetVersion.Net4 || runtime == NetVersion.Net4Client) { File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.dll"), Path.Combine(assembliesTempTarget, "NetOffice.dll")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.dll"), Path.Combine(assembliesTempTarget, item + "Api.dll")); } } else { string targetPackageName = null; switch (runtime) { case NetVersion.Net2: targetPackageName = Path.Combine(assembliesFolderPath, "2.0.zip"); break; case NetVersion.Net3: case NetVersion.Net35: targetPackageName = Path.Combine(assembliesFolderPath, "3.0.zip"); break; case NetVersion.Net45: targetPackageName = Path.Combine(assembliesFolderPath, "4.5.zip"); break; default: throw new ArgumentOutOfRangeException("runtime"); } using (ZipFile zip = new ZipFile(targetPackageName)) { Stream streamFirst = zip.GetInputStream(zip.GetEntry("NetOffice.dll")); FileStream fileStreamFirst = File.Create(Path.Combine(assembliesTempTarget, "NetOffice.dll")); streamFirst.CopyTo(fileStreamFirst); fileStreamFirst.Close(); foreach (var item in apps) { Stream stream = zip.GetInputStream(zip.GetEntry(item + "Api.dll")); FileStream fileStream = File.Create(Path.Combine(assembliesTempTarget, item + "Api.dll")); stream.CopyTo(fileStream); fileStream.Close(); } } } }
/// <summary> /// 新建网站站点 /// </summary> /// <param name="siteName">站点名</param> /// <param name="bindingInfo">绑定的相关信息 "*:<port>:<hostname>" <example>"*:80:myhost.com"</example></param> /// <param name="physicalPath">物理路径</param> /// <param name="queueLength">队列长度</param> /// <param name="maxProcesses">最大工作进程数</param> /// <param name="netVersion">.net clr版本</param> /// <param name="appPoolPipelineMode">应用程序池托管管道模式</param> /// <param name="rapidFailProtectionMaxCrashes">最大故障数</param> /// <param name="logDirectoryPath">IIS日志目录路径</param> /// <param name="logFormat">日志格式</param> /// <param name="logExtFileFlags">日志存储的字段</param> /// <param name="loggingRolloverPeriod">日志的存储计划</param> /// <param name="logTruncateSize">日志单个文件最大大小(字节)</param> public static void CreateSite(string siteName, string bindingInfo, string physicalPath, long queueLength, long maxProcesses, NetVersion netVersion, ManagedPipelineMode appPoolPipelineMode, long rapidFailProtectionMaxCrashes, string logDirectoryPath, LogFormat logFormat, LogExtFileFlags logExtFileFlags, LoggingRolloverPeriod loggingRolloverPeriod, long logTruncateSize) { var managedRuntimeVersion = netVersion == NetVersion.V2 ? NetVersion2 : NetVersion4; CreateSite(siteName, "http", bindingInfo, physicalPath, true, siteName, queueLength, ProcessModelIdentityType.ApplicationPoolIdentity, 120, null, null, maxProcesses, appPoolPipelineMode, managedRuntimeVersion, rapidFailProtectionMaxCrashes, logDirectoryPath, logFormat, logExtFileFlags, loggingRolloverPeriod, logTruncateSize); }
public async Task <dynamic> ExecuteTestAsync(RpcClient client) { var netVersion = new NetVersion(client); return(await netVersion.SendRequestAsync()); }
/// <summary> /// 新建网站站点 /// </summary> /// <param name="siteName">站点名</param> /// <param name="ip">ip 空字符串则为则直接默认 * </param> /// <param name="port">端口</param> /// <param name="hostName">主机名</param> /// <param name="physicalPath">物理路径</param> /// <param name="queueLength">队列长度</param> /// <param name="maxProcesses">最大工作进程数</param> /// <param name="netVersion">.net clr版本</param> /// <param name="appPoolPipelineMode">应用程序池托管管道模式</param> /// <param name="rapidFailProtectionMaxCrashes">最大故障数</param> /// <param name="logDirectoryPath">IIS日志目录路径</param> /// <param name="logFormat">日志格式</param> /// <param name="logExtFileFlags">日志存储的字段</param> /// <param name="loggingRolloverPeriod">日志的存储计划</param> /// <param name="logTruncateSize">日志单个文件最大大小(字节)</param> public static void CreateSite(string siteName, string ip, int port, string hostName, string physicalPath, long queueLength, long maxProcesses, NetVersion netVersion, ManagedPipelineMode appPoolPipelineMode, long rapidFailProtectionMaxCrashes, string logDirectoryPath, LogFormat logFormat, LogExtFileFlags logExtFileFlags, LoggingRolloverPeriod loggingRolloverPeriod, long logTruncateSize) { ip = String.IsNullOrWhiteSpace(ip) ? "*" : ip; CreateSite(siteName, $"{ip}:{port}:{hostName}", physicalPath, queueLength, maxProcesses, netVersion, appPoolPipelineMode, rapidFailProtectionMaxCrashes, logDirectoryPath, logFormat, logExtFileFlags, loggingRolloverPeriod, logTruncateSize); }
public async Task <object> ExecuteTestAsync(IClient client) { var netVersion = new NetVersion(client); return(await netVersion.SendRequestAsync()); }
internal void SetDefaults(string name) { fromExisting = false; isDLL = name.EndsWith(".dll") || name.EndsWith(".DLL"); if (isDLL) { characteristics = FileImage.dllCharacteristics; } else { characteristics = FileImage.exeCharacteristics; } lMajor = MetaData.LMajors[0]; lMinor = 0; fileAlign = FileImage.minFileAlign; osMajor = 4; osMinor = 0; userMajor = 0; userMinor = 0; subSysMajor = 4; subSysMinor = 0; subSystem = SubSystem.Windows_CUI; DLLFlags = FileImage.DLLFlags; cliMajVer = 2; cliMinVer = 0; corFlags = CorFlags.CF_IL_ONLY ; mdMajVer = 1; mdMinVer = 1; // MetaData Minor Version ECMA = 0, PEFiles = 1 netVersion = NetVersion.Everett; netVerString = MetaData.versions[0]; tsMajVer = 1; tsMinVer = 0; }
internal void SetVersionFromString() { for (int i=0; i < MetaData.versions.Length; i++) { if (MetaData.versions[i].Trim(nulls) == netVerString) { netVersion = (NetVersion)i; netVerString = MetaData.versions[i]; } } }
public NetApiService(IClient client) : base(client) { Listening = new NetListening(client); PeerCount = new NetPeerCount(client); Version = new NetVersion(client); }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { throw new NotImplementedException(); }
public override void Read(BinaryReader reader, NetVersion version) { base.Read(reader, version); }
protected internal void CopyUsedNetOfficeAssembliesToTempTarget() { string[] officeApps = Options.OfficeApps; NetVersion runtime = Options.NetRuntime; List <string> apps = CreateValidatedReferenceList(officeApps); string assembliesFolderPath = Program.DependencySubFolder; if (!Directory.Exists(assembliesFolderPath)) { assembliesFolderPath = Program.DependencyReleaseSubFolder; } string assembliesTempTarget = TempNetOfficePath; File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.dll"), Path.Combine(assembliesTempTarget, "NetOffice.dll")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.dll"), Path.Combine(assembliesTempTarget, item + "Api.dll")); } File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.xml"), Path.Combine(assembliesTempTarget, "NetOffice.xml")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.xml"), Path.Combine(assembliesTempTarget, item + "Api.xml")); } File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.pdb"), Path.Combine(assembliesTempTarget, "NetOffice.pdb")); foreach (var item in apps) { File.Copy(Path.Combine(assembliesFolderPath, item + "Api.pdb"), Path.Combine(assembliesTempTarget, item + "Api.pdb")); } //if (runtime == NetVersion.Net4 || runtime == NetVersion.Net4Client) //{ // File.Copy(Path.Combine(assembliesFolderPath, "NetOffice.dll"), Path.Combine(assembliesTempTarget, "NetOffice.dll")); // foreach (var item in apps) // File.Copy(Path.Combine(assembliesFolderPath, item + "Api.dll"), Path.Combine(assembliesTempTarget, item + "Api.dll")); //} //else //{ // string targetPackageName = null; // switch (runtime) // { // case NetVersion.Net2: // targetPackageName = Path.Combine(assembliesFolderPath, "2.0.zip"); // break; // case NetVersion.Net3: // case NetVersion.Net35: // targetPackageName = Path.Combine(assembliesFolderPath, "3.0.zip"); // break; // case NetVersion.Net45: // targetPackageName = Path.Combine(assembliesFolderPath, "4.5.zip"); // break; // default: // throw new ArgumentOutOfRangeException("runtime"); // } // using (ZipFile zip = new ZipFile(targetPackageName)) // { // Stream streamFirst = zip.GetInputStream(zip.GetEntry("NetOffice.dll")); // FileStream fileStreamFirst = File.Create(Path.Combine(assembliesTempTarget, "NetOffice.dll")); // streamFirst.CopyTo(fileStreamFirst); // fileStreamFirst.Close(); // foreach (var item in apps) // { // Stream stream = zip.GetInputStream(zip.GetEntry(item + "Api.dll")); // FileStream fileStream = File.Create(Path.Combine(assembliesTempTarget, item + "Api.dll")); // stream.CopyTo(fileStream); // fileStream.Close(); // } // } //} }