我目前正在iOS和Android上建立一个小团队的应用程序,虽然现在我只专注于Android.在他们的网站上,他们很早就说出了以下内容.
在继续之前,请从右侧菜单中选择您的Parse应用程序.这些步骤适用于您的"NameAppHere"应用.
从Application类的onCreate方法调用Parse.initialize来设置应用程序ID和客户端密钥:
public void onCreate() {
Parse.initialize(this, "XXXXXX", "XXXXXX");
}
Run Code Online (Sandbox Code Playgroud)
他们说我必须在Application类的onCreate方法中粘贴那些代码,尽管没有'Application'类或Application.java.我已经通过Android studio给我的一个菜单选项将他们的.jar文件复制到项目结构中.我在本演练之前指出我已经有一个现有的项目,所以我认为这不是问题所在.
我正在使用C#在.NET中构建一个小型网站.用户必须上传已经实现的Excel文件,扩展名为.xls或.xlsx.虽然我实际上无法从Excel文件中读取值.我现在写了这段代码:
public ActionResult Index(HttpPostedFileBase file)
{
string fileName = Path.GetFileName(file.FileName);
if (fileName.EndsWith(".xlsx") || (fileName.EndsWith(".xls")))
{
// store the file inside ~/App_Data/uploads folder
string path = Path.Combine(Server.MapPath("~/App_Data/uploads/"), fileName);
file.SaveAs(path);
// Get file info
int contentLength = file.ContentLength;
string contentType = file.ContentType;
// Get file data
byte[] data = new byte[] { };
using (var binaryReader = new BinaryReader(file.InputStream))
{
data = binaryReader.ReadBytes(file.ContentLength);
}
using (FileStream fs = File.Open(path, FileMode.OpenOrCreate))
{
UTF8Encoding temp = new UTF8Encoding(true);
while (fs.Read(data, 0, data.Length) > 0) …Run Code Online (Sandbox Code Playgroud)