我不知道这是允许的,但我有一个调用的ShowDialog用另一种形式,它试图拨打另一种形式相同的一种主要形式.
所以,例如:
form1 - > form2.showdialog - > form3.showdialog
我在form3的showdialog中收到错误:
var ssscu = new SSS.SssTwainSimple.MainForm();
ssscu.ShowDialog();
Run Code Online (Sandbox Code Playgroud)
这是错误:
{"形式的ShowDialog试图建立一个不合格的形式作为其所有者窗体不能拥有自己或自己的主人\ r \n参数名:所有者"}
我不知道我明白了什么问题,不允许我从一个形式,是一个对话框调用ShowDialog的?
谢谢,Eroc
我得到了一个方法来获取我们的数据库连接字符串到Sql Server:
SqlConnection GetConnectionString()
Run Code Online (Sandbox Code Playgroud)
我调用它并得到连接字符串应该是什么.如果数据库不存在,我需要没有数据库名称的连接字符串.如果我尝试使用带有数据库名称的连接字符串,我会收到一个错误,它无法连接到数据库,因为它不存在.
我打电话是这样的:
using (var connection = new SqlConnection(GetConnectionString().ConnectionString))
Run Code Online (Sandbox Code Playgroud)
有没有办法在没有数据库名称的情况下轻松地重新创建连接字符串?
我有一个Byte []字段,它是我需要加密的文件内容.没有什么特别的或花哨的,只是足以确保下一个获得它的人将无法轻易解码它.我会使用.Net Framework 4.0附带的加密,但我绝对不需要使文件比它更大.
我想过只是简单地反转数组或添加几个字节到最后......?
如果我可以避免使阵列变得更大,那将是伟大的.
有什么建议?
谢谢!
我有以下XAML:
<sdk:Label Content="{Binding RefreshTextToggle, Converter={StaticResource enumToText}, ConverterParameter=ItemsOfInterest,FallbackValue='Please select items of interest to you'}"
Style="{StaticResource StandardLabel}"
Height="{Binding ElementName=ItemsOfInterest,Path=Height}"/>
<ListBox Name="ItemsOfInterest"
ItemsSource="{Binding Path=ItemsOfInterest}"
Margin="5"
MinHeight="25"
Width="250"
HorizontalAlignment="Left">
Run Code Online (Sandbox Code Playgroud)
ItemsOfInterest的高度是动态的,等待其中有多少个元素.
有人看到我的高度绑定错误吗?它甚至没有与ItemsOfInterst相同的大小.
我读了这篇文章:
这两者彼此非常不同,尽管它们都旨在服务于同一目的.SFTP使用单个通道发送和接收所有相关数据,而FTPS使用另一个动态决定数据的通道.FTPS在通过防火墙时经常遇到问题,因为它不知道数据正在使用的端口,并且无法允许通过端口的流量.FTPS以文本格式发送消息,允许人们读取日志并确定会话期间发生的事情.SFTP无法做到这一点,因为消息不是文本,而是二进制.
阅读更多:FTPS和SFTP之间的区别| |之间的区别 FTPS与SFTP http://www.differencebetween.net/technology/internet/difference-between-ftps-and-sftp/#ixzz20KUGWr00
我不想假设任何事情,因为如果我错了,这会让我的工作更难,但当我通过C#/ .Net4发送文件时,这样:
var request = (FtpWebRequest) WebRequest.Create(FtpUrl + filename);
request.Method = WebRequestMethods.Ftp.UploadFile;
var secureString = new SecureString();
foreach (var b in Encoding.Default.GetBytes(FtpPassword))
secureString.AppendChar((char) b);
request.Credentials = new NetworkCredential(FtpUsername, secureString);
request.EnableSsl = true;
Run Code Online (Sandbox Code Playgroud)
这是SFTP还是FTPS?由于EnableSsl,我假设FTPS正如文章所示.
如果不是SFTP,我可以将其更改为SFTP吗?我在通过防火墙发送时遇到问题.
谢谢!
我们正在连接到C#中的数据库,然后在其上运行一些sql脚本.
我需要能够缩小当前数据库而不指定名称.
我们在程序中没有数据库名称,只是给出了连接并运行脚本.
这就是我的开始:
ALTER DATABASE SSSIndexes SET RECOVERY SIMPLE WITH NO_WAIT
GO
DBCC SHRINKFILE(N'SSSIndexes_Log', 1) <-- my issue is here
GO
Run Code Online (Sandbox Code Playgroud)
但我不知道数据库名称或日志文件名称.
可以吗?
我已经搜索了这个,但我找不到任何特定于此错误的内容或如何解决它.
我们在代码中的不同位置的不同计算机上间歇性地收到此错误.
这是错误:
电脑1:
Application: propane.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.SEHException
Stack:
at SSS.Base.FastTrans.PrintReceipt.MakeString()
at SSS.Base.FastTrans.PrintReceipt.PrintIt()
at SSS.Base.FastTrans.CCPayment.PrintReceipt()
at SSS.Base.FastTrans.CCPayment.BottomPanelEnabled()
at SSS.Base.FastTrans.CCPayment.btnContinue_Click(System.Object, System.EventArgs)
at System.Windows.Forms.Control.OnClick(System.EventArgs)
at System.Windows.Forms.Button.OnClick(System.EventArgs)
at System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs)
at System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message ByRef, System.Windows.Forms.MouseButtons, Int32)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ButtonBase.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Button.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form) …Run Code Online (Sandbox Code Playgroud) 我可以在Visual Studio 2010中发布没有问题但是当我尝试使用Visual Studio 2013发布时,我收到此消息:
项目中不存在目标"MSDeployPublish".\ Source2\Web Projects\SubService\subservice\subservice.csproj 0 0子服务
谁能告诉我我需要做些什么来解决这个问题?它发生在2个不同的项目中.
我正在搜索一个sql server数据库,显然它返回的数量超过了应用程序可以处理的数量.我正在回到许多结果的路上,我需要最小化发回的记录数,然后告诉用户他们选择了太多.
这是我有的:
private List<Log> SearchLog()
{
try
{
using (var model = new SuburbanPortalEntities())
{
var qry = from logs in model.Logs
where logs.LogDateTime > dateTimePicker_Start.Value &&
logs.LogDateTime < dateTimePicker_End.Value
select logs;
Guid tokenid;
if (Guid.TryParse(textBox_TokenId.Text, out tokenid))
{
qry = qry.Where(x => x.TokenId == tokenid);
}
if (!string.IsNullOrEmpty(textBox_SessionId.Text))
{
qry = qry.Where(x => x.SessionId == textBox_SessionId.Text.ToLower());
}
if (!string.IsNullOrWhiteSpace(textBox_Contains.Text))
{
qry = qry.Where(x => x.Message.Contains(textBox_Contains.Text));
}
if (checkedListBox_DisplayFilter.GetItemChecked(0))
{
qry = qry.Where(x => x.IsWarning);
}
if (checkedListBox_DisplayFilter.GetItemChecked(1))
{ …Run Code Online (Sandbox Code Playgroud) 我在批处理文件中有以下内容:
:REMOLDFILES
ECHO Removing files older than 14 days. >>%LOGFILE%
cd /d %BKUPDIR%
FOR /f "skip=14 delims=" %%A IN ('DIR /a:-d /b /o:-d /t:c %1*.zip ^2^>nul') DO IF EXIST "%%~fA" ECHO "%%~fA" >>%LOGFILE%
FOR /f "skip=14 delims=" %%A IN ('DIR /a:-d /b /o:-d /t:c %1*.zip ^2^>nul') DO IF EXIST "%%~fA" DEL "%%~fA" >>%LOGFILE%
FOR /f "skip=14 delims=" %%A IN ('DIR /a:-d /b /o:-d /t:c %1*.log ^2^>nul') DO IF EXIST "%%~fA" ECHO "%%~fA" >>%LOGFILE%
FOR /f "skip=14 delims=" %%A IN ('DIR …Run Code Online (Sandbox Code Playgroud) c# ×6
.net ×1
batch-file ×1
binding ×1
cmd ×1
command-line ×1
database ×1
encryption ×1
ftps ×1
linq ×1
msdeploy ×1
sftp ×1
silverlight ×1
sql ×1
t-sql ×1
windows ×1
winforms ×1
xaml ×1