我们有一个客户端/服务器应用程序,其中包括Windows服务和Winform客户端工具.我已经设法在Visual Studio中创建一个Wix项目(2010年,使用wix 3.5工具集).我在引用上使用"收获"功能而不是指定每个文件,因为涉及许多库项目.
我想弄清楚的问题:
如何包含引用的DLL?有些是在GAC中,有些是在工作区内的相对路径中.我假设我可以明确列出每个文件,但似乎应该有一种方法让Wix自动检测它们.
如何在启用"收获"时安装服务.我看到的所有示例都需要添加一个KeyPath = true的显式元素.但是这不适用于harvest = true设置.
我意识到收获功能可能是一种方便,当有更复杂的事情发生时,这是不可行的.我应该放弃收获并尝试明确指定每个文件吗?
我在Wix上看到的大多数示例都只是xml文件的片段.有什么地方我可以找到安装服务其他非平凡设置功能的完整实际示例吗?
我想使用boost :: transform_iterator和boost :: bind来返回成员函数的结果.
例如
class Foo
{
public:
//...
Bar& getBar();
const Bar& getBar() const;
};
Run Code Online (Sandbox Code Playgroud)
我有一个一元的Function对象来选择getBar()函数
struct getBar: public std::unary_function<Foo&,Bar&>
{
getBar::result_type operator()(getBar::argument_type arg ) const {
return arg.getBar()
}
};
Run Code Online (Sandbox Code Playgroud)
并且假设我已经在std :: vector中存储了几个Foo对象,我使用了类似的tranform_iterator
int main()
{
typedef std::vector<Foo> VEC;
typedef boost::transform_iterator<getBar,VEC::iterator> iterator;
VEC vec;
vec.push_back( Foo ());
iterator i( vec.begin() );
//...
Bar = *i;
return 0;
};
Run Code Online (Sandbox Code Playgroud)
但是,如果我想使用boost :: bind而不是getBar仿函数,我该怎么做呢.我不确定我必须将哪个模板参数传递给transform_iterator.
编辑:
使用boost :: function的解决方案是一个很好的开始,但我并不完全满意,所以尝试了一下并查看了boost :: mem_fn的返回类型
typedef boost::transform_iterator<boost::_mfi::mf0<Bar&,Foo>,VEC::iterator> iter;
typedef boost::transform_iterator<boost::_mfi::cmf0<const Bar&,Foo>,VEC::const_iterator> citer;
Run Code Online (Sandbox Code Playgroud)
但这个解决方案有另一个问题.因为
iter …Run Code Online (Sandbox Code Playgroud) 我目前在我的网站上缓存所有可能的东西(图片,JS,CSS).我只需要一次刷新一个JS文件.如何使用web.config忽略缓存中的一个文件,同时保留其他所有缓存的文件?
请注意,我在这里尝试了另一个链接,它似乎没有停止我的文件的缓存: 如何使用weserver配置设置禁用IIS 7中单个文件的缓存
我有以下模型和映射(下面的代码片段).
一场比赛必须从一开始就有多个与之相关的CompetitionAnswers(多选).
目前,使用下面显示的Fluent NHibernate映射,当我创建一个全新的Competition对象时,填充属性,然后创建3个全新的CompetitionAnswer对象并将它们添加到CompetitionAnswers属性(竞争中的属性),我希望调用Save在会话上将INS竞赛行和3个CompetitionAnswer行插入DB.
但是,当我尝试在会话上调用Save时,它会抱怨CompetitionId为null并且无法在该字段的CompetitionAnswers表中插入null - 这是对的,但是,我不应该这样做NHibernate首先创建竞赛,然后在CompetitionAnswers表中使用新生成的IDENTITY值(CompetitionId)?
比赛(模特)
public virtual int CompetitionId { get; private set; }
public virtual string Title { get; set; }
public virtual string Description { get; set; }
public virtual IList<CompetitionAnswer> CompetitionAnswers { get; set; }
Run Code Online (Sandbox Code Playgroud)
CompetitionAnswer(型号)
public virtual int CompetitionAnswerId { get; set; }
public virtual string Answer { get; set; }
public virtual Competition Competition { get; set; }
Run Code Online (Sandbox Code Playgroud)
CompetitionMap(流利的NHibernate制图)
public CompetitionMap()
{
Id(x => x.CompetitionId)
.GeneratedBy.Native();
Map(x => x.Title);
Map(x => x.Description); …Run Code Online (Sandbox Code Playgroud) 我们有一个.net表单启用auth启用的站点,用户通过我们的Android应用程序中的WebViewClient访问.该站点的一个功能是能够登录和下载某些PDF文件,但是您需要登录才能下载PDF.
我们正在实施shouldOverrideUrlLoading并在满足正确条件时通过以下代码下载pdf.
URL u = new URL(url);
URLConnection conn = u.openConnection();
int contentLength = conn.getContentLength();
DataInputStream stream = new DataInputStream(u.openStream());
byte[] buffer = new byte[contentLength];
stream.readFully(buffer);
stream.close();
DataOutputStream fos = new DataOutputStream(new FileOutputStream("/sdcard/download/file.pdf"));
fos.write(buffer);
fos.flush();
fos.close();
Run Code Online (Sandbox Code Playgroud)
从IIS日志中可以看出,IIS不会考虑将此请求登录并将其重定向到登录页面.
我们需要的是一种下载文件的方法,文件下载请求中保留了auth cookie,但我们不知道如何保留cookie.
对我们来说另一个可行的解决方案是在WebViewClient和Android浏览器之间保留auth cookie.如果我们可以这样做,我们只需通过浏览器中的默认操作打开PDF文件.
编辑:看起来我可以手动设置auth cookie
conn.setRequestProperty("Cookie", "");
Run Code Online (Sandbox Code Playgroud)
现在我只需要弄清楚如何从WebViewClient中读取auth cookie
我有这个代码:
<script type="text/javascript">
function js() {
var getJs = document.getElementById("jogo");
if (JS == true) { //if button JS is pressed - it is correct?
< script type = "text/javascript"
src = "file1.js" >
} else < script type = "text/javascript"
src = "file2.js" >
</script>
}
</script>
Run Code Online (Sandbox Code Playgroud)
它不起作用.我给了两个按钮,如果第一个按下,file1.js应该加载.如果按下第二个,file2.js应加载.
我怎样才能做到这一点?
如何让Safari的调试器在页面刷新期间保持断点?我正在尝试调试在onLoad上执行的代码,所以我没有时间在代码执行之前设置断点,当我在设置断点后刷新页面时,断点就会丢失.
(有问题的代码在Dojo小部件中,因此如果重要的话,它将通过XHR加载.)
出于某种原因,我无法让Nexus通过默认公共组服务我的SNAPSHOT工件.我已经阅读了Nexus手册的相关内容并搜索了Google,但我所做的一切似乎都无法解决.
我在第4.2节中实现了这些内容.(配置Maven使用单个Nexus组)本手册,所以我的settings.xml如下所示:
<settings>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://my-server/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Run Code Online (Sandbox Code Playgroud)
一切都工作正常,直到我开始在干净的机器上构建东西(即我没有构建任何SNAPSHOT项目的东西)并且它不会下载所需的SNAPSHOT依赖项.Maven给了我以下内容:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyCo Actions Base Classes 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://my-sever/nexus/content/groups/public/com/myco/testing/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://my-sever/nexus/content/groups/public/com/myco/testing/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://my-sever/nexus/content/groups/public/com/myco/testing/1.0.0-SNAPSHOT/testing-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.myco:testing:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: …Run Code Online (Sandbox Code Playgroud) 我们希望在每个查询其"上次修改日期"的ASP.NET页面中嵌入一些代码,并将其显示在页面底部.
过去,我们依靠对页面进行任何更改的人员手动更新页面底部的" 此页面最后修改日期(今天日期) "文本.很多时候,他们忘记更新这一点,这导致在该特定页面上最后更新信息时出现一些混淆.由于该站点不是基于可以将此信息存储在其后端数据库中的CMS,因此我们尝试确定上次从服务器上的文件系统保存页面的时间,并将该日期包含在页面文字.
我不确定基于母版页的页面是如何进入"最后修改日期"的.我们真正想要的是内容页面文件的LMD被查询,因此我们可以将其嵌入页面文本而不是它所基于的母版页的LMD.
谢谢!