想要从命令提示符读出(Want a readout from command prompt)
我目前拥有最简单的简单批处理文件“ping 8.8.8.8”它所做的只是ping谷歌4次,并报告时间,以及4次ping的最小值,最大值和平均值。 我想要做的就是这样我可以按下键盘上的按钮(我有一个黑寡妇,启用了宏)或者只是打开一个程序,并让它ping,然后报告只有最大,最小和平均时间,作为角落的叠加。 这可能是在批处理文件中还是我必须提升到更强大的功能?
I currently have the simplest of simple batch files "ping 8.8.8.8" all it does is ping google 4 times, and report back the times, along with the minimum, maximum and average from the 4 pings. What I want to do is make it so that I can press a button on my keyboard (I have a blackwidow, with macros enabled) or maybe just open a program, and have it ping, then report back with only the max, min and average times, as an overlay in the corner. Is this possible within a batch file or do I have to move up to something more powerful?
原文:https://stackoverflow.com/questions/28036660
最满意答案
如果使用以下接口,则在通过接口操作类时,set方法将不可用:
interface IMyInterface { int property { get; } }
然后,您可以像这样实现类:
class MyClass : IMyInterface { int property { get; protected set; } }
If you use the following interface the set method will be unavailable when classes are manipulated via the interface:
interface IMyInterface { int property { get; } }
You could then implement the class like this:
class MyClass : IMyInterface { int property { get; protected set; } }
相关问答
更多-
让委托调用这些方法..并根据bool值执行其中的任务或让它通过... Let the delegate call these methods.. and depending on the bool value perform the task in them or just let it pass...
-
IEnumerable
MaliciousCode : MaliciousCode是MaliciousSmall对象的可迭代集合? 所以它意味着它代表了一个集合,并提供了一些迭代它的方法? 排序 - IEnumerable 提供了一个方法 - GetEnumerator - 返回一个IEnumerator 。 该界面允许您迭代集合。 Pre-Linq所有IEnumerable允许你做的是在foreach循环中使用该集合(或直接使用提供的IEnumerator ,这是 ... -
c#中的基接口(Base interface in c#)[2023-07-12]
因为IFoo : IBaseFoo ,实现IFoo每个类也实现了IBaseFoo 。 但不是相反,所以你可以简单地检查typeCls is IFoo是否typeCls is IFoo 。 请注意,基于实现的接口改变行为通常是一种设计气味,它首先绕过了接口的使用。 Because IFoo : IBaseFoo, every class implementing IFoo also implements IBaseFoo. But not the other way around, so you can si ... -
如何调用接口中定义的方法并在C#中的类中实现?(How to call a method defined in interface and implemented in class in C#?)[2022-08-11]
private IAp app = new Ap(); 这是因为Ap实现了IAp 。 你不能做你想做的事情的原因是因为你使用的是显式接口实现,接口方法只能在对接口而不是类的引用上可见。 有关显式接口实现的详细信息,请参阅显式接口实现教程 。 另一个工作是不使用显式接口实现,但这可能会让您直接引用类型,这通常不被认为是最佳实践。 代码仅显示已更改的签名实现。 public class Ap : IAp { public Output Process(double min, double max, I ... -
如何从C#中的接口隐藏已实现属性的set方法?(How to hide set method of an implemented property from an interface in C#?)[2022-04-18]
如果使用以下接口,则在通过接口操作类时,set方法将不可用: interface IMyInterface { int property { get; } } 然后,您可以像这样实现类: class MyClass : IMyInterface { int property { get; protected set; } } If you use the following interface the set method will be unavailable when classes a ... -
我看到它的方式,你可以通过两种方式来解决这个问题。 首先是让TrackList实现IEnumerable
-
如何使用自定义属性? 然后你的课堂会看起来像这样: [Cacheable(Level = CacheLevels.Application)] public class Country { } [Cacheable(Level = CacheLevels.User)] public class Department { } 您可以在这里阅读如何创建自己的自定义属性,然后使用反射访问其值。 How about using a custom attribute? Your classes then would ...
-
这里要做的最好的事情是创建自己的继承System.Collections.ObjectModel.Collection
并重写InsertItem的集合类。 The best thing to do here is to create your own collection class that inherits System.Collections.ObjectModel.Collection and overrides InsertItem. -
不,修改集合的任何东西都不会调用setter。 ObservableCollection类存在于此特定目的 - 您可以在列表的位置使用它。 您仍然应该使用INotifyPropertyChanged并将其作为包含更改通知的属性,以便如果替换整个集合,则会触发该事件。 编辑,示例: public ObservableCollection
SomeProperty { get { return _someProperty; } set ... -
但是,即使它是私有财产,我仍然可以通过IBase界面访问它! 这不是私人财产。 它只是一个使用显式接口实现的属性。 这意味着它通过界面公开,但只能通过界面获得。 显式接口实现主要是为了使实现“矛盾”接口变得可行,以及用于“阻止”(但不禁止)使用某些接口方法。 这并不意味着给人的印象是成员根本不存在。 从根本上说,听起来你不应该在这里使用继承 - 如果你不想让某些东西能够充当IBase ,你就不应该继承IBase 。 However, even though it's a private property, ...