我尝试将文件上传到FTP服务器上的目录.我用这个方法FtpWebRequest.我想将一个文件上传到该用户的主目录,但我总是收到以下错误消息:
请求的URI对此FTP命令无效.
有什么问题?我试过关闭被动模式,但它仍然是一样的.
static void FtpUpload()
{
// Get the object used to communicate with the server.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://12.22.44.45");
request.Method = WebRequestMethods.Ftp.UploadFile;
request.UsePassive = false;
// This example assumes the FTP site uses anonymous logon.
request.Credentials = new NetworkCredential("pokus", "password");
// Copy the contents of the file to the request stream.
StreamReader sourceStream = new StreamReader(path);
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
sourceStream.Close();
request.ContentLength = fileContents.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse(); …Run Code Online (Sandbox Code Playgroud) 我想从Phoengap应用程序添加到App Store中其他应用程序的链接.
我尝试在webview中打开这个URL:
通过这篇文章 http://bjango.com/articles/ituneslinks/
但不适合我.子浏览器窗口打开,但显示屏上没有显示任何内容.
怎么做正确?
非常感谢任何帮助.
我试图找到一些在我的Phonegap应用程序中实现Admob的教程(Admob不再支持移动网站).我尝试了这些教程:
- 将admob广告添加到您的phonegap应用程序
- Google AdMob Ads Android Fundamentals
这些在Phonegap V1.8中不起作用.
是否有任何可行的解决方案或替代方案?
我注意到我的Angular也在每个POST请求之前创建了OPTIONS请求.
我正在使用自定义API服务进行HTTP请求处理.
app.service('ApiService', function ($http) {
/**
* Process remote POST request to give URL with given params
* @param {String} url
* @param {String} POST params
* @return {JSON} response from server
*/
this.doHttpRequest = function (type, url, params) {
return $http({
method: type,
url: url,
data: params,
timeout: 5000,
headers: {
"Content-Type": "application/json",
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
问题是:
我怎样才能禁用它(配置值放在哪里)?
OPTIONS是否适合某些事情?我认为这就像"2台服务器之间的握手".
角度版本:1.2.15
谢谢你的建议.
我正在尝试将头和顶部导航栏放在ion-view指令中.
如果ion-view页面初始化,如果我在标签页面之外放置标题导航栏,则会闪烁黑色.
但是,如果我尝试在标题内插入标题和顶部导航栏,ion-view则不会显示标题中的标题.
有人能告诉我我做错了什么吗?
也许里面的一些标签丢失了?
谢谢你的帮助.
这是模板的代码:
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-view>
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' …Run Code Online (Sandbox Code Playgroud) 我有基于Cordova和Ionic的移动应用程序.在应用程序启动后加载的默认页面需要使用SQLLite插件.
https://github.com/brodysoft/Cordova-SQLitePlugin
问题是该视图包含
ng-init="setData()"
Run Code Online (Sandbox Code Playgroud)
这是调用控制器方法在哪里使用SQL Lite插件.并且因为在未初始化deviceready事件之前调用该方法(插件只能在deviceready事件之后初始化).
所以我尝试了这个解决方法:
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
db = window.sqlitePlugin.openDatabase({name:"callplanner"});
}
Run Code Online (Sandbox Code Playgroud)
但这不适合我.
所以我试过第二个解决方案
.factory('cordova', function () {
return {
test: function(){
document.addEventListener("deviceready", this.ready, false);
},
ready: function(){
alert("Ready");
db = window.sqlitePlugin.openDatabase({name:"callplanner"});
}
}
})
Run Code Online (Sandbox Code Playgroud)
并在控制器初始化我试过:
cordova.test();
Run Code Online (Sandbox Code Playgroud)
但这不起作用(在ng-init之后触发devicereadfy).
之后我发现了这篇文章:
http://java.dzone.com/articles/ionic-and-cordovas-deviceready
但我不明白如何在应用程序准备好之前放置"启动画面"以及如何设置超时.
有人知道如何解决这个问题?
非常感谢您的任何建议或帮助.
我想为此代码设置自定义图标(ionicons)大小:
<button class="button button-icon icon ion-stop customIconSound"></button>
Run Code Online (Sandbox Code Playgroud)
对于class customIconSound我试过以下:
button.customIconSound,button.button-icon {
font-size: 52px !important;
color: #fff;
line-height: 55px!important;
}
Run Code Online (Sandbox Code Playgroud)
但没有运气.如果我尝试没有按钮按钮图标类的图标类,我认为它正在工作,但没有按钮类图标没有按下状态(因为它不是按钮).
我该怎么解决呢?
谢谢你的建议.
我是Angular的新手,我尝试在costroller的一个函数中为ng-grid声明gridOption.
它会导致错误:
TypeError:无法设置未定义的属性'gridDim'
我尝试使用$ scope.apply和ng-if在模板中解决它.但是,这对我没有任何影响.
谢谢你的建议:
控制器的方法:
$scope.getTest = function() {
$http.get('http://www.iNorthwind.com/Service1.svc/getAllCustomers')
.success(function (data, status, headers, config) {
//$scope.myData = data;
console.log('Sucess' + data);
// definition for ng-grid table
$scope.myData = [{ name: "Moroni", age: 50 },
{ name: "Tiancum", age: 43 },
{ name: "Jacob", age: 27 },
{ name: "Nephi", age: 29 },
{ name: "Enos", age: 34}];
$scope.gridOptions = { data: 'myData' };
//$scope.$apply();
})
.error(function(data, status, headers, config) {
$scope.myData = data;
});
};
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用本教程在我的应用程序中添加Google分析:
https://developers.google.com/analytics/devguides/collection/android/v4/
但我坚持这个问题,在哪里准确地说:
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
所以我的build.gradle顶级文件看起来像这样:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.3.0-beta1'
apply plugin: 'com.google.gms.google-services'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
但这是错误的.请问应该在哪里放置apply plugin?
谢谢你的帮助.