我正在寻找一个解决方案来获取枚举的完整字符串.
例:
Public Enum Color
{
Red = 1,
Blue = 2
}
Color color = Color.Red;
// This will always get "Red" but I need "Color.Red"
string colorString = color.ToString();
// I know that this is what I need:
colorString = Color.Red.ToString();
Run Code Online (Sandbox Code Playgroud)
那么有解决方案吗?
有没有办法删除特定端口的每个 urlacl 保留。
我的意思是这样的事情是可能的(客户星座):
netsh http add urlacl url=http://localhost:55521/ user="everyone"
netsh http add urlacl url=http://+:55521/ user="everyone"
Run Code Online (Sandbox Code Playgroud)
现在我想删除55521端口的所有保留,这可以是任何ip星座!
顺便说一句,我在 ac# 应用程序中使用 nancy 自主机执行此操作。
我正在使用角度,所以打字稿,并尝试从可观察的返回承诺。
这样做的正确方法是什么?
我试过:
of(EMPTY).toPromise() // error: Promise<Observable<never>>' is not assignable to type Promise<void>
of(null).toPromise() // no error but not sure if it is the right way
of().toPromise // error: Promise<Observable<unknown>>' is not assignable to type Promise<void>
Run Code Online (Sandbox Code Playgroud)
更新:
// 这是声明它的接口
export interface CustomStoreOptions extends StoreOptions<CustomStore> {
/** Specifies a custom implementation of the remove(key) method. */
remove?: ((key: any | string | number) => Promise<void> | JQueryPromise<void>);
}
Run Code Online (Sandbox Code Playgroud)
所以它被称为:
let store = new CustomStore({
remove: key => {
// return ... …
Run Code Online (Sandbox Code Playgroud) c# ×2
angular ×1
enums ×1
linq2db ×1
miniprofiler ×1
nancy ×1
netsh ×1
nlog ×1
observable ×1
promise ×1
self-hosting ×1
sql ×1
tostring ×1
typescript ×1