我的ac #dll定义如下:
namespace SMSNotificationDll
{
public class smsSender
{
public void SendMessage(String number, String message)
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "c:\\Program Files\\Java\\jdk1.6.0_24\\bin\\java";
info.WorkingDirectory = "c:\\";
info.Arguments = "-jar SendSms.jar "+number + " "+message;
info.UseShellExecute = false;
Process.Start(info);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我需要从命令行执行它.
有什么方法可以通过rundll32运行它吗?
当我用它运行它:
rundll32 SMSNotificationDll.dll, SendMessage 0749965244 hello
Run Code Online (Sandbox Code Playgroud)
我错过了条目:SendMessage.
是否可以在类似于iOS开发的Windows Phone 8开发中使用私有API?
当然,这不是关于将要发布的应用程序(AppStore/Marketplace).但是,非公开项目有很多用例,开发人员希望调用内部系统函数.
安装Windows Phone 8 SDK后,可以安装位于"C:\ Program Files(x86)\ Microsoft SDKs\Windows Phone\v8.0\Emulation\Images"中的Windows Phone 8 Emulator映像.在Windows Phone操作系统的主分区中,可以导航到Windows\System32并使用Dependency Walker或IDA Pro等工具检查系统DLL文件.
有很多功能听起来非常有趣但是没有公开可用,因此没有记录.问题是:是否可以通过应用程序或其他方式以某种方式调用它们?
只是一些有趣的函数的例子(还有更多):
我试图让LoadLibrary(特别是LoadLibraryExA)以某种方式在本机Windows Phone App项目中工作,并加载和调用这些函数(加载库工作).简而言之,在尝试调用函数时,我最终会遇到访问冲突错误或类似错误(可能是因为沙盒执行环境).另一个问题是,我只能猜测函数的签名(参数).我用我使用的工具找不到它们.
由于一些防火墙问题,我们需要使用"活动"模式进行FTP(即不通过启动PASV命令).
目前,我们使用的代码如下:
// Get the object used to communicate with the server.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.contoso.com/test.htm");
request.Method = WebRequestMethods.Ftp.UploadFile;
// This example assumes the FTP site uses anonymous logon.
request.Credentials = new NetworkCredential ("anonymous","janeDoe@contoso.com");
// Copy the contents of the file to the request stream.
StreamReader sourceStream = new StreamReader("testfile.txt");
byte [] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
sourceStream.Close();
request.ContentLength = fileContents.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
response.Close();
Run Code Online (Sandbox Code Playgroud)
但这似乎默认使用被动模式; 我们能否影响它以强制它使用活动模式上传(与命令行ftp客户端相同)?
我目前正在编写一个程序,它接受一个指定的文件并用它执行一些操作.目前,它打开它,和/或将其附加到电子邮件并将其邮寄到指定的地址.
该文件可以是以下格式:Excel,Excel报表,Word或PDF.
我目前正在做的是用文件的路径生成一个进程然后启动进程; 但是我也正在尝试修复我添加的错误功能,它根据指定的设置将动词"PrintTo"添加到启动信息中.
我想要完成的任务是我想打开文档,然后将自己打印到程序本身命名的指定打印机.然后,文件应自动关闭.
如果没有办法一般地执行此操作,我们可能能够为每种单独的文件类型提供一种方法.
这是我正在使用的代码:
ProcessStartInfo pStartInfo = new ProcessStartInfo();
pStartInfo.FileName = FilePath;
// Determine wether to just open or print
if (Print)
{
if (PrinterName != null)
{
// TODO: Add default printer.
}
pStartInfo.Verb = "PrintTo";
}
// Open the report file unless only set to be emailed.
if ((!Email && !Print) || Print)
{
Process p = Process.Start(pStartInfo);
}
Run Code Online (Sandbox Code Playgroud)
仍然难倒......可能会像微软那样称呼它,'那是设计'.
我有一个表格,用于保存已发送的电子邮件.我决定在此表中添加一个TimeStamp字段,以便我可以跟踪电子邮件的发送时间.数据正在写入表中而没有任何问题,但当我使用Microsoft SQL Server 2008 Management Studio查看表内容时,Timestamp字段中包含的数据显示如下:0x000000000000000000845,即使在已写入的记录中也是如此自引入Timestamp值以来到数据库
然后我将字段类型更改为datetime,然后显示日期.但它显示日期1900-01-01 00:00:23.然后我将其更改回Timestamp字段,然后返回到当前的十六进制格式.
我做错了吗?
干杯
基本上用户应该能够点击一个链接并下载多个pdf文件.但Catch是我无法在服务器或任何地方创建文件.一切都必须在记忆中.
我能够创建内存流和Response.Flush()它作为PDF格式,但如何在不创建文件的情况下压缩多个内存流.
这是我的代码:
Response.ContentType = "application/zip";
// If the browser is receiving a mangled zipfile, IIS Compression may cause this problem. Some members have found that
// Response.ContentType = "application/octet-stream" has solved this. May be specific to Internet Explorer.
Response.AppendHeader("content-disposition", "attachment; filename=\"Download.zip\"");
Response.CacheControl = "Private";
Response.Cache.SetExpires(DateTime.Now.AddMinutes(3)); // or put a timestamp in the filename in the content-disposition
byte[] abyBuffer = new byte[4096];
ZipOutputStream outStream = new ZipOutputStream(Response.OutputStream);
outStream.SetLevel(3);
#region Repeat for each Memory Stream
MemoryStream fStream = CreateClassroomRoster();// This returns …Run Code Online (Sandbox Code Playgroud)
我们需要计算人群中的人数,我们已经使用了opencv_traincascade它,但它检测到很多东西.
我们可以使用的另一种方法是什么?
我在用C#编写的项目中跟踪遗留代码.
我找到以下代码:
public class FooCollection : Collection<IFoo> {};
Run Code Online (Sandbox Code Playgroud)
我不明白为什么(以及何时)我们需要像这样创建我们自己的Collection类.
为什么不直接使用内置的集合(array,List<T>,Dictionary<K,V>,...)
什么是数据结构Collection<T>?阵列?或链表?
引用System.Drawing.Imaging命名空间的文档
Encoder类使用户能够扩展GDI +以支持任何图像格式.
然而,我找不到任何文档,示例或其他任何解释我如何实现自己的自定义文件格式的内容 - 大多数搜索返回有关传递EncoderParameters的大量信息,但没有实现我们自己的编码器的信息?
理想情况下,我希望能够在C#中实现这一点,但如果需要,我准备将我的ATL清除掉:)
有没有人遇到任何文档或能够提供有关如何处理此问题的任何指示?
更新:
我应该提到我迄今为止尝试过的事情,但无济于事:
我将ExportForm本地化为德语(de)和俄语(ru),如下所示:

如果我的CultureInfo是德语(Austrian-de-AT),那么一切都好,我看到格式翻译成德语:
string specCult = "de-AT";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);
Run Code Online (Sandbox Code Playgroud)
但我看到英文UI与俄罗斯(ru-RU)CultureInfo
string specCult = "ru-RU";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);
Run Code Online (Sandbox Code Playgroud)
虽然如果我使用"ru"而不是"ru-RU"来创建CultureInfo,它可以工作:
string specCult = "ru";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);
Run Code Online (Sandbox Code Playgroud)
你能帮我解决一下可能引起的问题吗?或者请指出我调查问题的方向.
c# ×7
.net ×2
api ×1
collections ×1
database ×1
detection ×1
ftp ×1
gdi+ ×1
head ×1
localization ×1
memorystream ×1
opencv ×1
printers ×1
private ×1
process ×1
rundll32 ×1
shellexecute ×1
sql-server ×1
winforms ×1
zip ×1