我正在使用Delphi和Crystal Reports 9.0 ActiveX对象.
我知道我可以从这样的文件加载报告:
crApplication.OpenReport(AFileName)
但是,我想将我的报告存储在内存中,并从内存而不是文件中打开它.我不想在我的磁盘上创建任何临时文件.
有任何想法吗?
谢谢你的时间.
我正在使用DotNetOpenAuth在我们的Web应用程序中集成openID.以下代码向提供商请求信息.
try
{
var req = openid.CreateRequest(Request.Form["openid_identifier"]);
req.AddExtension(new DotNetOpenAuth.OpenId.Extensions.SimpleRegistration.ClaimsRequest
{
Email = DotNetOpenAuth.OpenId.Extensions.SimpleRegistration.DemandLevel.Require,
FullName = DotNetOpenAuth.OpenId.Extensions.SimpleRegistration.DemandLevel.Require,
Nickname = DotNetOpenAuth.OpenId.Extensions.SimpleRegistration.DemandLevel.Request,
PostalCode = DotNetOpenAuth.OpenId.Extensions.SimpleRegistration.DemandLevel.Request
});
return req.RedirectingResponse.AsActionResult();
}
Run Code Online (Sandbox Code Playgroud)
出于某种原因,来自openID提供商的响应永远不会附带我要求的信息.以下是代码:
// Stage 3: OpenID Provider sending assertion response
switch (response.Status) {
case AuthenticationStatus.Authenticated:
Session["FriendlyIdentifier"] = response.FriendlyIdentifierForDisplay;
FormsAuthentication.SetAuthCookie(response.ClaimedIdentifier, false);
if (!string.IsNullOrEmpty(returnUrl)) {
return Redirect(returnUrl);
} else {
return RedirectToAction("Index", "Home");
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试过:response.ClaimedIdentifier以百万种方式而且它从来没有我可以做的有价值的信息.有任何想法吗?
我正在尝试更新解决方案中的许多不同项目以获得新版本号.有没有一种简单的方法来同步所有项目的版本号fileversion和clickonce选项?
回答
最后通过编写一个小工具解决了这个问题:
Sub Main()
Try
Console.WriteLine("Updating version numbers")
Dim strPath As String = System.AppDomain.CurrentDomain.BaseDirectory()
Dim strAppName As String = ""
Console.WriteLine(strPath)
If My.Application.CommandLineArgs.Count > 0 Then
Console.WriteLine(My.Application.CommandLineArgs(0))
strPath = My.Application.CommandLineArgs(0)
strAppName = My.Application.CommandLineArgs(1)
Else
strPath = "C:\Projects\APP\"
Console.WriteLine("Error loading settings")
End If
Dim strAssemblyInfoFile As String = strPath + "Properties\AssemblyInfo.cs"
If Not File.Exists(strAssemblyInfoFile) Then
strAssemblyInfoFile = strPath + "My Project\AssemblyInfo.vb"
End If
Console.WriteLine("Loading " + strAssemblyInfoFile)
Dim strFileContent As String
strFileContent = ReadFileText(strAssemblyInfoFile)
Dim AssemblyVersionRegex As New Regex("AssemblyVersion(?:Attribute)?\(\s*?""(?<version>(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<build>[0-9]+)\.(?<revision>[0-9]+))""\s*?\)")
Dim …
Run Code Online (Sandbox Code Playgroud) 在我目前的项目中,我们使用其他插件参数所需的一些插件,如properties-maven-plugin或buildnumber-plugin.
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<packaging>pom</packaging>
<version>v0</version>
<name>myProject</name>
<properties>
<env>dev</env>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<files>
<file>${basedir}/configurations/${env}.properties</file>
</files>
</configuration>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.wakaleo.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
<configuration>
<databaseType>mysql</databaseType>
<database>${database.schema}</database>
<host>${database.host}</host>
<user>${database.user}</user>
<password>${database.pwd}</password>
</configuration>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
问题在于,当您直接执行插件目标时,不会执行初始化阶段(或验证)上绑定的目标.因此要生成模式间谍,我们需要输入:
$> mvn org.codehaus.mojo:properties-maven-plugin:read-project-properties schemaspy:schemaspy
Run Code Online (Sandbox Code Playgroud)
我们想告诉你需要为每个maven命令执行属性插件和buildNumber插件,这样我们就可以输入:
$> mvn schemaspy:schemaspy
Run Code Online (Sandbox Code Playgroud)
是否有一种干净的方法(没有脚本)?
我想将日期/时间舍入到图表应用程序的最近区间.我想要一个像下面这样的扩展方法签名,以便可以在任何精度级别上实现舍入:
static DateTime Round(this DateTime date, TimeSpan span);
Run Code Online (Sandbox Code Playgroud)
我的想法是,如果我通过十分钟的时间跨度,它将四舍五入到最接近的十分钟间隔.我不能理解我的实施,并希望你们中的一个人之前会写过或使用类似的东西.
我认为楼层,天花板或最近的实施都可以.
有任何想法吗?
编辑:感谢@tvanfosson和@ShuggyCoUk,实现如下:
public static class DateExtensions {
public static DateTime Round(this DateTime date, TimeSpan span) {
long ticks = (date.Ticks + (span.Ticks / 2) + 1)/ span.Ticks;
return new DateTime(ticks * span.Ticks);
}
public static DateTime Floor(this DateTime date, TimeSpan span) {
long ticks = (date.Ticks / span.Ticks);
return new DateTime(ticks * span.Ticks);
}
public static DateTime Ceil(this DateTime date, TimeSpan span) {
long ticks = (date.Ticks + span.Ticks - …
Run Code Online (Sandbox Code Playgroud) 如果我只想在create上进行验证,那么我可以做
validates_presence_of :password, :on => :create
Run Code Online (Sandbox Code Playgroud)
但是我怎么说创建和更新?我尝试了这个,但它不起作用:
validates_presence_of :password, :on => [ :create, :update ]
Run Code Online (Sandbox Code Playgroud)
我必须定义两次验证吗?
在Visual Studio 2008中,如果配置类型是静态库,我在项目属性中看不到链接器选项.我需要为静态库指定/ MACHINE:x64选项.我试图在Librarian的命令行选项中指定它.只有这样我才能构建静态库.如果我没有指定/ MACHINE编译静态库使用LNK1112失败:模块机器类型'X86'与目标机器类型'x64'冲突(即使我将平台设置为X64用于我的解决方案).
使用/ MACHINE:X64通过Project-Properties-Librarian指定为命令行,构建了静态库,但是同一解决方案中的其他项目(配置类型:DLL)依赖于静态库,当构建DLL并尝试使用lib中的一个函数我再次得到相同的错误:
致命错误LNK1112:模块机器类型'X86'与目标机器类型'x64'冲突
请建议,如何构建64位静态库
我正在使用Tomcat 5.5.9和Apache 2.x.
我们尝试在ProxyPass中使用与Tomcat上下文名称不同的路径名.
ProxyPass /path http://localhost:8080/contextname
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用.当这两个相同时,一切正常.
我在网上看到的大多数示例都具有等于Tomcat上下文名称的路径.
我在Tomcat上下文中使用"context.xml",并且没有"server.xml"条目.此外,我使用普通的httd.conf并且不使用任何VirtualHost条目.
任何帮助表示赞赏.
问候,
Diptenu
鉴于下面的每个输入,我想在该位置获得可用空间.就像是
long GetFreeSpace(string path)
Run Code Online (Sandbox Code Playgroud)
输入:
c:
c:\
c:\temp
\\server
\\server\C\storage
Run Code Online (Sandbox Code Playgroud) @"F:\LEAFPRODUCT\Bin\Service.exe"
Run Code Online (Sandbox Code Playgroud)
这是物理路径Service.exe
,让我知道是否有任何其他替代方式或任何一般方法来查找WrmService.exe
窗口应用程序中的物理路径.
在Web应用程序中,我们可以Server.MapPath
像这样使用.在这里,我需要减少路径的意思
label1.Text = AssemblyName.GetAssemblyName(@"F:\LEAFPRODUCT\Bin\Service.exe").Version.ToString();
Run Code Online (Sandbox Code Playgroud)
这是我需要在这里减少物理路径的编码,这意味着我不想把这种方式放在我需要的所有文件夹中
label1.Text = AssemblyName.GetAssemblyName("WrmService.exe").Version.ToString();
Run Code Online (Sandbox Code Playgroud)
表示此处仅显示所需的文件名 WrmService.exe
c# ×3
64-bit ×1
activex ×1
algorithm ×1
apache ×1
asp.net-mvc ×1
assemblyinfo ×1
c ×1
com ×1
delphi ×1
diskspace ×1
maven-2 ×1
maven-plugin ×1
mod-proxy ×1
model ×1
openid ×1
tomcat ×1
validation ×1
version ×1
winforms ×1