[英]insert full path of folder which located locally to json file
this is my json file, i want to insert to 'url' the following path: C:\\Users\\yw1kew\\AppData\\Local\\dmv\\dmv.data\\cameraApp but I want it to be locally to any computer. 这是我的json文件,我想在“ url”中插入以下路径:C:\\ Users \\ yw1kew \\ AppData \\ Local \\ dmv \\ dmv.data \\ cameraApp,但我希望它在任何计算机本地。 then i need to start write the path from appdata some way i think how should I do that ?
那么我需要以某种方式开始写appdata的路径,我认为我应该怎么做?
{
"version": "0.3.4.0",
"url": "",
"productSources": {
"ps": ""
}
}
Thanks to answers!!! 感谢答案!!!
$scope.data= {
"version": "0.3.4.0",
"url": "",
"productSources": {
"ps": ""
}
}
//updating the url value
$scope.data.url="C:\Users\yw1kew\AppData\Local\dmv\dmv.data\cameraApp";
})
I assume you want the answer in javascript which is implicitly on your tags. 我假设您想要标记中隐含的javascript中的答案。 Here is how you do it using javascript
这是您使用JavaScript的方法
var jsonFile = `{
"version": "0.3.4.0",
"url": "",
"productSources": {
"ps": ""
}
}`;
var url = "C:\\Users\\yw1kew\\AppData\\Local\\dmv\\dmv.data\\cameraApp";
var jsonObject = JSON.parse(jsonFile);
jsonObject.url = url;
var jsonString = JSON.stringify(jsonObject);
Where jsonString
is the final string with the path in it. 其中
jsonString
是其中包含路径的最终字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.