|
this is where i really like that "my" thingy in vb.net
accessing folders and special directories is so easy with the my.computer.filesystem
but "yay" u can use the my namespace in c# by adding a refrence to your C# project for Microsoft.VisualBasic and this code :
<br />
using Microsoft.VisualBasic.Devices;<br />
and then use it like this:
<br />
foreach(string file in Microsoft.VisualBasic.FileIO.FileSystem.GetFiles("C:/myfolder")<br />
{<br />
}<br />
of cource this is not at all the best way to do it, just i'm vb.net user mostly
|
|
|
|
|
hi to all,
i have a c# application on a server and i want to call it from a php page and i have to pass to it a parameter, how can i do it?
thanks a lot
Teo
|
|
|
|
|
Running an application on the server from a webpage would be a major security breach. You should find another way.
only two letters away from being an asset
|
|
|
|
|
i don't think that's a problem, it's a very simple console application that's do few operation.
Do u know how to pass and how to return parameters?
thanks
Teo
|
|
|
|
|
Running ANY application from a webpage page is a security risk, regardless of how simple the application is. Much effort has gone into securing browsers to not allow them to do this. Would you allow me to run an application on your system from my website? Just a simple app, say cmd.exe?
only two letters away from being an asset
|
|
|
|
|
ok, so wich one could be a solution to call function of a program on a server passing a parameter?
|
|
|
|
|
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace AEXMLAdapterTester
{
internal sealed class NativeMethods
{
private NativeMethods() {}
[DllImport("AEXMLAdapter.dll", EntryPoint="GetAllSettings", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern uint GetAllSettings(StringBuilder lpBuffer, ref uint lpnSize);
[DllImport("AEXMLAdapter.dll", EntryPoint= "SetAllSettings", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern uint SetAllSettings(string lpBuffer);
[DllImport("AEXMLAdapter.dll", EntryPoint= "ReloadSettings", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern uint ReloadSettings();
};
///
/// Summary description for XmlAdapterInterop.
///
///
internal sealed class XmlAdapterInterop
{
private XmlAdapterInterop() {}
public static string GetAllSettings()
{
uint retVal;
StringBuilder buffer = null;
uint size = 0;
retVal = NativeMethods.GetAllSettings(null, ref size);
if (retVal == 122)
{
buffer = new StringBuilder((int)size);
retVal = NativeMethods.GetAllSettings(buffer, ref size);
}
if (retVal != 0)
throw new ApplicationException("Interop Error calling GetAllSettings");
return buffer.ToString();
}
public static void SetAllSettings(string buffer)
{
uint retVal;
retVal = NativeMethods.SetAllSettings(buffer);
if (retVal != 0)
throw new ApplicationException("Interop Error calling SetAllSettings - retVal = " + retVal);
}
public static void ReloadSettings()
{
uint retVal;
retVal = NativeMethods.ReloadSettings();
if (retVal != 0)
throw new ApplicationException("Interop Error calling SetNothing - retVal = " + retVal);
}
}
}
These code running correctly in Windows 2003 server 32Bit
but when use in Windows Server 64Bit when i invoke XmlAdapterInterop.GetAllSettings() an exception occured "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
Any one can help me, i will thank you a lot
I want to make some friends here
|
|
|
|
|
I have no experience with Win64, but I expect some problems;
in your case "ref size" now becomes a 64-bit pointer, and both parties
should agree on that.
I googled "pinvoke 64bit" and found several hits,
one
says "If you rely on 32-bit libraries you should make sure your app runs with the 32-bit framework" ...
Luc Pattyn
|
|
|
|
|
I have experienced this exception before. I would say the most likely cause is that AEXMLAdapter.dll, or some other library you are using, is not compiled in 64bit mode.
only two letters away from being an asset
|
|
|
|
|
I have get some informations from you guys and i select platform target X86 in build tag
then run again, it is ok.
if the AEXMLAdapter.dll build in x86 machine so the project must build in x86 mode?
As the program is a unit test assembly, when i try to build in x86 mode, the Nunit cannnot open the assembly.
Any body has some experience in this issue?
I want to make some friends here
|
|
|
|
|
How can I create DBF file with 866 code page, and then fill it from SQL table with 1232 codepage.
Apparently I want all values to be transliterated to 866 codepage correctly.
|
|
|
|
|
err
|
|
|
|
|
|
Hi All!
I have this application of mine which works well. It even used to work on Vista. (I work on XP most of the time).
There are some ManagedC++ assemblies in the project.
Now when I try to start the project under vista, when I try to access classes in the ManagedC++ assemblies I get this error:
==========================================
Exception : System.IO.FileLoadException
Message : Could not load file or assembly 'NScribe, Version=1.0.2553.30928, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. (Exception from HRESULT: 0x800736B1)
Source : NovaMindEditor
Help :
OSVersion : Microsoft Windows NT 6.0.5600.0
Thread :
Stack :
at NovaQuickStart.Program.StartApp(String[] args)
at NovaQuickStart.Program.Main(String[] args) in C:\Development\Development\Windows\NovaQuickStart\Program.cs:line 59
-------- Caused by Exception --------
Exception : System.Runtime.InteropServices.COMException
Message : The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. (Exception from HRESULT: 0x800736B1)
Source :
Help :
Stack :
==========================================
Any ideas?
|
|
|
|
|
I am using the following code snippet to generate a multi frame/page Tiff file from a collection of images of varying sizes and dpi values for a new image viewing web/app control I am writing for the new company web site...
System.Drawing.Imaging.Encoder enc =
System.Drawing.Imaging.Encoder.SaveFlag;
EncoderParameters eParms = new EncoderParameters(1);
eParms.Param[0] = new EncoderParameter(
enc,
(long)EncoderValue.MultiFrame
);
Bitmap image = (Bitmap)this[0].Image.Clone();
image.Save(
PathToImage.AbsolutePath,
GetEncoderInfo("image/tiff"),
eParms
);
for (int index = 1; index < this.Count; index++)
{
eParms.Param[0] = new EncoderParameter(
enc,
(long)EncoderValue.FrameDimensionPage
);
try
{
image.SaveAdd(
(Bitmap)this[index].Image.Clone(),
eParms
);
}
catch (Exception ex)
{
errorMessage.Error(ex);
debug.Info(ex);
}
}
eParms.Param[0] = new EncoderParameter(
enc,
(long)EncoderValue.Flush
);
image.SaveAdd(eParms);
This code basically is a method in an imaging array class. It is designed to iterate through the list of images in the array/collection and add each, in turn, to the end of a Tiff image, forming a multi frame Tiff. The resulting image "seems" valid, since it can correctly be read in the Windows Image and Fax viewer, and I can page to each image in using the next/previous buttons... so I know they are there.
However, when I go to read it back in, the number of images reported by
int Frames = img.GetFrameCount(FrameDimension.Page);
is always 1, no matter how many images I put into it,
so the call to
SelectActiveFrameCount(FrameDimension dim, int FrameNo);
always selects the first frame, regardless of what FrameNo is set to. This code is a varyation of code I have found several times from several sites, including Microsoft's.
I am using .NET 2.0 / Visual Studio 2005 / C#.
Am I leaving something out? Can multi frame Tiffs handle a variety of image sizes in the same Tiff file? What could be wrong? My suspicion is that the call to "SaveAdd()" should be generating a new frame entry for the list of frames along with the image itself, but it only adds the image without adding the related frame information. Is there some extra (unmentioned) code that I should add to get it to create the extra frame entry?
|
|
|
|
|
I am using c# Express and trying to deploy a program that uses an .mdb file. It tries to use the same path that the original was in and the installation fails since that directory does not exist.
How do I get it to place it, and look for it, in the same directory as the program?
David Wilkes
|
|
|
|
|
Using a deployment project? I simply add it to the application folder.
|
|
|
|
|
Thanks for the reply!
I have been beating on this for a while now. When I add the MDB to the project it will not install. I get an error “Can not start the application”. When I look at the details I see this;
COMPONENT STORE TRANSACTION FAILURE SUMMARY
* Transaction at [1/19/2007 11:43:18 AM]
- Staging of a component file (CDMAConverter.mdb) did not succeed.
- Staging of a component file (Gamorrean.ico) did not succeed.
- Staging of a component (CDMA_Converter.exe.genman) did not succeed.
- Staging of a component file (CDMA_Converter.exe) did not succeed.
- Installation of deployment (file:///E:/CDMA_Converter.application#CDMA_Converter.application, Version=1.0.2.0, Culture=neutral, PublicKeyToken=2022ca6c0b1c5b65, processorArchitecture=msil) did not succeed.
- Setting one or more of the deployment metadata did not succeed.
And this in the “Transactions Details”
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x80070057
- File: CDMAConverter.mdb
David Wilkes
|
|
|
|
|
manually creating manifest and application files using mageui.exe.
I had to do it this way in my plugin-like application because the project deployment does't include not referenced files like plugin dlls and I guess it won't include an mdb file..
|
|
|
|
|
|
Hi, everybody.
Could anyone help me with this subtle and foolish question?
My question is: How do you turn on and off the insertion point(blinking cursor)like in TextBox in C#?
Thanks.
|
|
|
|
|
Focus another control. Alternately, you could try P/Invoking the HideCaret[^] method of the Win32 API. No idea if that will work though.
|
|
|
|
|
Are you using a TextBox? Designing your own control? What?
Do you want it off? Or blinking?
|
|
|
|
|
No, I am justing creating a window form and dragged/dropped a TextBox onto the form.
And when the form in running I want to hold the insertion point off until user clicks either (EDIT) or (Add) button is clicked.
At that point I want the user click any Input TextBox to type in any data the user desires in the TextBox.
As you all expect, as soon as the window is running and when you click the TextBox, eventhough no (EDIT) or (ADD) button
is clicked, you will see the cursor (inertion point) is blinking ready to accept the input.
I want the cusor to be off until the user clicks either (EDIT) or (ADD) is clicked.
Is my description clear enough?
Thanks.
|
|
|
|
|
Seems you want TextBox.Enabled=false or even TextBox.Visible=false
until (EDIT) or (ADD) are clicked.
Luc Pattyn
|
|
|
|