首页 \ 问答 \ Facebook在应用程序内执行(无需在Safari或本机应用程序中打开)(Facebook Implementation within app (without opening in safari or native app))

Facebook在应用程序内执行(无需在Safari或本机应用程序中打开)(Facebook Implementation within app (without opening in safari or native app))

我已经通过http://developers.facebook.com/docs/guides/mobile/下载了用于iPhone的FBCOnnect示例代码。但是,它在Safari或设备上打开了Facebook页面,本机应用程序已打开,应用程序已切换到背景我不希望发生这种情况。同样,方法回调像' - (void)fbDidLogin'在登录后根本不会被调用。


I have gone through the FBCOnnect sample code for iPhone downloaded from http://developers.facebook.com/docs/guides/mobile/ But it opens the facebook page in safari or on device the native app is opened and the app is switched in Background I dont want this to happen.Also the method callbacks like '- (void)fbDidLogin' is not called at all after login.


原文:https://stackoverflow.com/questions/6280963
更新时间:2023-10-29 10:10

最满意答案

要获取AppData目录,最好使用GetFolderPath方法:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

%AppData%是一个环境变量,并且它们不会在.NET中的任何位置自动扩展,但您可以明确地使用Environment.ExpandEnvironmentVariable方法。 我仍然强烈建议您使用GetFolderPath ,因为约翰内斯·罗塞尔在评论中指出,在某些情况下,可能不会设置%AppData%

最后,创建路径,如您的示例所示:

var fileName = Path.Combine(Environment.GetFolderPath(
    Environment.SpecialFolder.ApplicationData), "DateLinks.xml");

To get the AppData directory, it's best to use the GetFolderPath method:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

(must add using System if not present).

%AppData% is an environment variable, and they are not automatically expanded anywhere in .NET, although you can explicitly use the Environment.ExpandEnvironmentVariable method to do so. I would still strongly suggest that you use GetFolderPath however, because as Johannes Rössel points out in the comment, %AppData% may not be set in certain circumstances.

Finally, to create the path as shown in your example:

var fileName = Path.Combine(Environment.GetFolderPath(
    Environment.SpecialFolder.ApplicationData), "DateLinks.xml");

相关问答

更多
  • 名为lpszPath的SHGetSpecialFolderPath()的第三个参数标记为__out 。 这样的事应该做: // Beware, brain-compiled code ahead! wchar_t buffer[MAX_PATH]; BOOL result = SHGetSpecialFolderPath( hWnd , buffer , CSIDL ...
  • 这是最短的方法: $env:APPDATA 或本地应用数据: $env:LOCALAPPDATA This is the shortest way: $env:APPDATA or for local app data: $env:LOCALAPPDATA
  • 要获取AppData目录,最好使用GetFolderPath方法: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) %AppData%是一个环境变量,并且它们不会在.NET中的任何位置自动扩展,但您可以明确地使用Environment.ExpandEnvironmentVariable方法。 我仍然强烈建议您使用GetFolderPath ,因为约翰内斯·罗塞尔在评论中指出,在某些情况下,可能不会设置%AppData ...
  • 你的第二条路是绝对路径 - 它以一个反斜杠开始。 该方法的行为如文件所述 : 如果path2包含绝对路径,则此方法返回path2。 只需删除主要的反斜杠,它应该没问题。 string sPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string test = Path.Combine(sPath, @"Microsoft\Windows\Start Menu\SkillControl\"); You ...
  • 这些调用不会返回错误的路径。 它们返回运行应用程序的用户的AppData\Roaming路径,即LocalService用户。 如果要访问其他用户的AppData,请将服务配置为在要读取或写入其配置文件的用户下运行,或者选择其他目录并确保该服务具有写入该权限的权限 - 但您确实应该这样做写在另一个用户的目录中。 These calls don't return the wrong path. They return the AppData\Roaming path of the user under whi ...
  • \\192.168.2.79\c$\Data\Users\DefaultAccount\AppData\Local\Packages\f2f9d0b2-0e90-4494-bcbf-12da27846733_dd744mn1wdq44\AC\Temp\de-DE\index.html 。 我该如何正确转换? 目前,使用ms-appdata:///协议只能访问三个文件夹。 LocalState: ms-appdata:///local/ TempState: ms-appdata:///temp/ Roami ...
  • 这是因为在Eclipse中运行应用程序时,进程的所有者是Windows用户 - ZXC ,而将Tomcat作为服务运行,它最有可能将其作为LocalSystem运行,并且%AppData%默认位置对于每个用户 。 正确的将环境变量传递给Tomcat的方式不需要依赖于用户特定的路径,而是为Windows创建一个文件CATALINA_BASE/bin/setenv.bat或CATALINA_HOME/bin/setenv.bat (针对* nix环境的setenv.sh)和在里面设置你可能需要在应用程序中使用的 ...
  • 假设Example App是运行代码的应用Example App则使用该应用程序检索第一个目录 string strFilePath = Path.Combine(Application.ExecutablePath, "Data.ini"); 第二个看起来不像设置的位置,但为此,您可以尝试Application和Environment类。 尝试类似 string strFilePath = Path.Combine(Application.UserAppDataPath, "Data.ini"); 我 ...
  • 使用以下内容 #!/usr/bin/perl use warnings; use strict; my $localConfPath = $ENV{localappdata}; my $appdata = $ENV{appdata}; print $localConfPath; #will print the app path - C:\users\xxx\AppData\local print $appdata; #prints - C:\users\xxx\AppData\Roaming U ...
  • 我也遇到过这个问题并看了你的问题,但我乍一看并没有找到答案。 这是Mohit shah答案 “我发现通过在配置文件”LocalSystem“下运行服务,无法从Windows服务获取用户appdata路径。所以我使用了Environment.SpecialFolder.CommomAppData,它在Windows 7上运行时为我提供应用程序数据路径C:\ ProgramData在Windows服务中使用相同的东西,它也提供相同的路径,我也在配置文件“LocalSystem”下运行服务,所以它没有提示我输入凭 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。