|
Hi every body
I Need a Simpe Ftp client program with source code (C#) and it work truely
Any one can help me?
|
|
|
|
|
You didnt search on CP or Google, did you?
|
|
|
|
|
yes I did,but my finds didnt works unfortunately.
|
|
|
|
|
Google results for ftp client c# source[^]. You really need to learn how to use a search engine...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i need to use the native code(unmanaged code),and i have to use void*,so i use the "unsafe" symbol then i meet the trouble
c++code:
SC_InitAsk sca;
memset(&sca, 0, sizeof(sca));
sca.m_Head.m_nType = SC_INIT;
sca.m_dwSoftware = 0x12345678;
sca.m_hWnd = m_hWnd;
m_Dll.SCInit(&sca, sizeof(sca)
c# code:
unsafe
{
SC_InitAsk sca = new SC_InitAsk();
sca.m_Head.m_lIndex = PublicValue.SC_INIT;
sca.m_dwSoftware = 0x12345678;
sca.m_hWnd = this.Handle;
SCInit(&sca, sizeof(SC_InitAsk));
}
c++ interface:
BOOL WINAPI SCInit(void *pInit, int nSize);
c# reference definition:
public unsafe static extern bool SCInit(void* pInit, int nSize);
---------
my trouble:
when debug c#,i got dismatching error with the c++ interface,then i can't find out what's wrong,for the reason may be the struct definition or the "void *"
so how i can work it out ,or how i can debug this?
gary.ruan
|
|
|
|
|
You don't have to use unsafe code here. Why not do something like this.
C#
[DllImport("yourdll")]
public static extern bool SCInit( System.Intptr pInit, int nSize )
Now in your function do this:
SC_InitAsk sca = new SC_InitAsk();
sca.m_Head.m_lIndex = PublicValue.SC_INIT;
sca.m_dwSoftware = 0x12345678;
sca.m_hWnd = this.Handle;
System.IntPtr p;
p = Marshal.AllocHGlobal( Marshal.Sizeof( typeof( SC_InitAsk ) ) );
Marshal.StructureToPtr( sca, p, true );
SC_Init( p, Marshal.Sizeof( typeof( SC_InitAsk ) );
Marshal.FreeHGlobal( p );
I hope this helps.
Andy
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
hi i want encrypt exe file in hdd . when my program is running after testing some conditions the exe file that encrypted , decrypting and running (like stream playing)
and i want my program works like "TZ Executable Protector".
TZ Executable Protector get an exe file and encrypt it and create loader exe and one key file .when you click on executable load it's test key file and run encrypted exe file (decrypting and running)
my problem is : ican file encrypt exe file and save it on hdd,but when i want decrypt exe file and run it ,i don't want that save decrypted exe file in hdd. i want to decrypt and run it in the same time.
thanks...
|
|
|
|
|
Compilation to native code (so that a exe can't be simply disassembled by reflector) isn't enough?
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
Hello to all,
I have to develop a project which can implement RTP Audio-Video Streaming. I found so many document releed to this. I also know he packet formate of RTP. But still not know that how to start .
I have problem with codecs. How can i use different codecs with it. & also i dont found any example that realy implement this packet formate.
Is there any ready made component which i can use with my project. I see the component WinRTP. It is good but it is limied with use if codecs. It does not support all codecs & also not support video at all.
I use C#.Net to implement my project.
Regards,
Divyang Mithaiwala
|
|
|
|
|
please,
how can i make an activex control (i need an ocx file! and not a dll) with visual studio .net and c#?
thanks! kopi_b
|
|
|
|
|
AFAIK, this is not possible. You can, however, build a dll that is exposed to COM and should behave identically to ocx objects.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
unfortunately i need the activex in another software that can just read ocx files and no dlls
but thanks anyway!
|
|
|
|
|
This is just a shot in the dark, but have you tried renaming the dll as an OCX? I'm not familiar with the differences, but I believe a COM dll and an OCX file are similar if f not the same.
|
|
|
|
|
i'll try that on monday
but i don't think it's possible
|
|
|
|
|
It's not possible. The C# compiler (or any of the .NET Framework Managed languaged) cannot possibly target building an .OCX file. You also can't just rename a .NET .DLL to .OCX and expect it to work. An .OCX file is a native (processor code) image whereas all .NET assemblies are MSIL code. Even using NGen on the resulting image to convert it to native code wont work either because .NET Framework assemblies don't support exports of the type required by an .OCX file.
You'll have to go back to Visual Studio 6 (VC++ or VB) or build the control using unmanaged Visual C++.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Dave, so even if a .NET dll is exposed to COM by the runtime (thus making it a kind of ActiveX control), this still isn't possible? After doing some research, it looks like an .ocx differs very little from a standard COM/ActiveX control. Since one can build ActiveX control by exposing your type to COM, isn't it then possible to have an OCX built from managed code? My understanding is that the ComVisible attribute causes the assembly to be exposed to COM, thus allowing for things like ActiveX objects.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
Judah Himango wrote: Since one can build ActiveX control by exposing your type to COM
An ActiveX control is, for all intensive purposes, an OLE object that supports, at a minimum, the IUnknown interface.
You can exposed a .NET component to COM, but that doesn't make it an ActiveX control. You're actually just registering a COM Callable Wrapper for a .NET Assembly. By default, the standard wrapper automatically generates the interfaces for IUnknown, IDispatch, and INew, among others. Any of which can be overridden with a custom implementation, or removed entirely.
If his other app that needs these controls can work with a COM-exposed .NET component, great! Obviously, his clients will still have to have the .NET Framework installed for this thing to work. So knowing that, it kind of makes it a pain to write an "ActiveX" component in .NET, drop into a web page, and expect it to work on all clients. A normal ActiveX control doesn't really need any other support for it to work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yep, I understood all that. So if his client can work with COM object with a .NET backend (that is, a .NET assembly exposed to COM), could he build a .NET library with an .ocx extension?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
Ya know, I've never tried to rename a .NET assembly to .OCX and register the thing. Might work, might not...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I am new to c# and I want to know how to or anyone can suggest to me a code to prevent my textbox from accepting any assigned character or number???
Help me please!!!!!
|
|
|
|
|
In .NET 2.0 there is a MaskedTextBox control that might help you. Otherwise, you can do manual prevention of character entering by overriding the TextBox's Validating event.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
The following connectionString is present in App.Config
<configuration>
<appsettings>
<add key="ConnectionString" value="Data Source=machine1;Initial Catalog=database1;User Id=user1;Password=password1;">
Now I would like to retrieve it using the following code
public static string GetConnectionString
{
get
{
return ConfigurationManager.AppSettings["ConnectionString"];
}
}
Is this correct?
Thanks
|
|
|
|
|