是否有一个简单的语句可以在Delphi中给出类似于paramstr()的结果?
我在Delphi Prism中编写了一个ASP.NET Web应用程序(不是站点).在我的devlopment机器上一切正常,但是当我在测试服务器上安装它时,我收到以下错误:
Server Error in '/MyApp' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: 'Oxygene' is not a supported language.
Source Error:
Line 1: <%@ Application CodeBehind="Global.asax.pas" Inherits="MyApp.Global_asax" Language="Oxygene" %>
Source File: /MyApp/global.asax Line: 1
Run Code Online (Sandbox Code Playgroud)
我已经阅读了我在网上找到的所有内容.有几篇文章提到了一个RemObjects页面(http://devcenter.remobjects.com/articles/?id={B549AFB8-04C8-4574-B185-30DE14369E66}),遗憾的是,它不再存在.
一些链接表明您可以将Language ="Oxygene"更改为Language ="C#".尝试这会产生不同的错误:
Compiler Error Message: CS1061: 'ASP.login_aspx' does not contain a definition for 'ForgottenUsernameLinkButton_Click' and …Run Code Online (Sandbox Code Playgroud) 我想使用controlpaint.DrawReversibleLine方法绘制一行,并尝试传递system.windows.point,但它需要system.drawing.point输入.我有点困惑.它们之间有什么区别?或者除了明显的差异外,它们有何不同?
谢谢,
对于这个问题,我确实梳理了Stackoverflow类似的问题以获得答案.虽然他们中的很多人都很有帮助,但他们并没有解决我的问题.我的程序使用graphics.DrawLines方法在winform上绘制多边形,如下所示.
g.DrawLines(thepen,pts);
Run Code Online (Sandbox Code Playgroud)
但是不断提高,"参数无效",错误.所以,我按如下方式改变了这行代码,看它是否有任何区别.
g.DrawLines(new pen(color.Black),pts);
Run Code Online (Sandbox Code Playgroud)
再一次,它提出了同样的错误.pts是system.drawing.point的数组,thepen是system.drawing.pen.
如果我完全评论它,我的程序没有问题,它不会引起任何错误.然而,奇怪的是,过去3或4个月内,相同的代码工作得很好.从昨天开始,我似乎无法让它再次运作.
是否需要设置winform的属性设置?
更新这是实际的绘制方法
method TMakerPoly.Draw;
var
pts: Array of point;
i:integer;
theBrush1:HatchBrush;
theBrush2:SolidBrush;
begin
if (theBrushStyle = HatchStyle.Wave) then
theBrush1 := new HatchBrush(theBrushStyle,Color.Transparent,color.Transparent)
else if (theBrushStyle = HatchStyle.ZigZag) then
thebrush2 := new SolidBrush(FillColor)
else
theBrush1 := new HatchBrush(theBrushStyle,FillColor,color.Transparent);
if (thePen.DashStyle = DashStyle.Custom) then
thepen.Color := Color.Transparent;
pts := new point[pcount];
if pcount >= 2 then
begin
if Active then
begin
for i := 0 to pcount-1 do
pts[i] := point(points[i]);
Translate(var pts,pcount);
thepen.Color …Run Code Online (Sandbox Code Playgroud) 当我尝试在delphi prism中编译我的应用程序时,我遇到了这些错误
C:\ Users\Burak\Documents\Visual Studio 2008\Projects\Project1\WindowsApplication1\WindowsApplication1\Main.pas(6,3):错误:(PE17)命名空间"Windows"不存在或没有公共类型C:\ Users\Burak\Documents\Visual Studio 2008\Projects\Project1\WindowsApplication1\WindowsApplication1\Main.pas(7,3):错误:(PE17)命名空间"Tlhelp32"不存在或没有公共类型
我做错了吗?
使用Windows,Tlhelp32,System.Drawing,System.Collections,System.Collections.Generic,System.Linq,System.Windows.Forms,System.Windows,System.ComponentModel;
我使用2009 delphi prism,小答案可以解决我的问题(我认为我的问题是愚蠢的,但我不能使用CreateRemoteThread,而WriteProcessMemory没有它).
最诚挚的问候,Burak TAMTURK
要么我完全不了解事件是如何工作的,要么Delphi Prism已经疯了!!!
我有一个winform,mousedown事件和mousemove事件.每当我单击鼠标左键时,MouseDown事件会按预期触发,但ALSO MouseMove事件会在未设置时触发.
以下是我的winform设计器中的一段代码,其中方法被分配给事件.
self.ClientSize := new System.Drawing.Size(751, 502);
self.KeyPreview := true;
self.Name := 'Maker';
self.Text := 'Window Maker';
self.Load += new System.EventHandler(@self.Maker_Load);
self.FormClosing += new System.Windows.Forms.FormClosingEventHandler(@self.Maker_FormClosing);
self.Shown += new System.EventHandler(@self.Maker_Shown);
self.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(@self.Maker_MouseDoubleClick);
self.MouseDown += new System.Windows.Forms.MouseEventHandler(@self.Maker_MouseDown);
self.MouseMove += new System.Windows.Forms.MouseEventHandler(@self.Maker_MouseMove);
self.MouseUp += new System.Windows.Forms.MouseEventHandler(@self.Maker_MouseUp);
self.Paint += new System.Windows.Forms.PaintEventHandler(@self.Maker_Paint);
self.ObjectPopup.ResumeLayout(false);
self.ResumeLayout(false);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?请帮助我对此感到沮丧,因为我在程序的其他部分有鼠标移动事件.他们工作正常.我似乎无法弄清楚为什么这个特定的mousemove事件正在起作用.
有人可以告诉我我的案例陈述的写法是什么是完全错误的.我看不出它有什么问题,但编译器不断提出以下错误,"重复案例项:'0',"与HatchSytle.Horizontal的行.如果我注释掉那条线就可以了,编译没有任何错误.
如您所见,我正在检查的元素都不相同.所以,我不应该得到任何错误.如果我错了,请纠正我.
case TMakerGraphic(obj).theBrushStyle of
HatchStyle.Min: BrushStyleCombo.SelectedIndex := 1;
HatchStyle.ZigZag: BrushStyleCombo.SelectedIndex := 0;
HatchStyle.BackwardDiagonal: BrushStyleCombo.SelectedIndex := 2;
HatchStyle.ForwardDiagonal: BrushStyleCombo.SelectedIndex := 3;
HatchStyle.Cross: BrushStyleCombo.SelectedIndex := 4;
HatchStyle.DiagonalCross: BrushStyleCombo.SelectedIndex := 5;
HatchStyle.Horizontal: BrushStyleCombo.SelectedIndex := 6; <<<< Line raising error.
HatchStyle.Vertical: BrushStyleCombo.SelectedIndex := 7;
end;
Run Code Online (Sandbox Code Playgroud)
谢谢
也许在Stackoverflow中提出了类似的问题,但我似乎无法找到解决问题的方法.
我只想打开一个可写的二进制流,并能够使用相同的流将数据附加到该文件.显然,如果您打开一个文件进行写入,它将删除它包含的所有数据并启动一个新文件.另外,如果你打开一个文件只是为了阅读,你不能写,但只能阅读.人们确实建议在线使用两个独立的流 - 一个用于阅读,另一个用于写作.我认为在这种情况下不会起作用.
看看我的示例代码,我想做类似的事情:
fs:BinaryWriter;
fs := new BinaryWriter(File.Create('c:\test.dat'));
fs.seek(0,SeekOrigin.End);
fs.Write('test string');
fs.Close;
Run Code Online (Sandbox Code Playgroud) 我在winform上有datagridview,你可以添加和删除它.虽然我能够成功地做到这一点,但它很奇怪.
它要求将其属性RowCount设置为1或更大.因此,即使没有添加任何项目,也始终显示单行网格.
你如何克服这个缺点?或者有办法吗?
谢谢,
delphi-prism ×10
.net ×6
oxygene ×5
delphi ×3
winforms ×2
append ×1
asp.net ×1
binaryreader ×1
binarywriter ×1
datagridview ×1
drawing ×1
events ×1
graphics ×1
mousedown ×1
mousemove ×1
namespaces ×1
remobjects ×1
rowcount ×1