Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在应用程序C#中存储Restful路径?_C#_C# 4.0 - Fatal编程技术网

如何在应用程序C#中存储Restful路径?

如何在应用程序C#中存储Restful路径?,c#,c#-4.0,C#,C# 4.0,我使用Windows窗体 有一个类NetworkManager,它通过Restful路径对服务器进行请求。路径就是URL 我必须把这些路径放到另一个类中并阅读它们。怎么做 只是创建一个带有静态路径列表的新静态类?允许的方式是什么?如果值从未更改,则在中声明具有常量字符串的静态类就可以了 public static class RestUrls { public const string URL_USER = ""; } 另外,考虑将值存储在App.CONFIG文件中。如下:静态常量字符

我使用Windows窗体

有一个类
NetworkManager
,它通过Restful路径对服务器进行请求。路径就是URL

我必须把这些路径放到另一个类中并阅读它们。怎么做


只是创建一个带有静态路径列表的新静态类?允许的方式是什么?

如果值从未更改,则在中声明具有常量字符串的静态类就可以了

public static class RestUrls
{
    public const string URL_USER = "";
}

另外,考虑将值存储在App.CONFIG文件中。

如下:<代码>静态常量字符串urLuUs= =“”/<代码>