|
I developed one website for my product.So now i would like to add some indian payment gateway API for the selling of my product through CC/Debit Card/Netbanking system.could anyone plz assist me for making that integration in to my site or please refer me some links on the same...
Thanks in Advance..
Srikanth P
|
|
|
|
|
You will probably need to contact the site that provides the gateway in the first instance.
|
|
|
|
|
|
hi
i transfer file from A to B Through WebService
after the was transfer i need to read his size.
i know how to do it, but when i try to read the file size i get:
The process cannot access the file XXX.XXX because it is being used by another process
what i can do ?
thanks in advance
|
|
|
|
|
Without knowing how your code works, we can only guess at the methods you used.
However, this kind of error normally comes up because the objects you created to access and copy the file have not been properly released, and are waiting for the Garbage Collector to come in and free them. The file will remain in use until that happens.
Look at your file transfer code, and call Dispose on all your objects rather than just letting them go out of scope.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Assuming you've copied the file, are you sure it's being copied synchronously and the operation completed?
If you're using some sort of stream writer to write the data into the new file, you need to make sure the stream has been flushed/closed/disposed.
As for disposal, the same goes for any other instances you've created that implement IDisposable. If you can (if they're not used further down the line), make sure that they are disposed (with a using statement or calling the Dispose method).
|
|
|
|
|
Did you mean to post that to me?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Of course he did... you obviously need the help :P
|
|
|
|
|
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I have a C#.net winform project which uses few libraries which are also created by me. Now I am creating a COM wrapper and want to use the same libraries from an excel file through VBA. But I do not want the excel to create a new instance of the libraries. I need to use the same instance of the libraries which are loaded by the winform prject. Please suggest a way.
Thanks in advance.
|
|
|
|
|
When you create a COM Callable Wrapper (CCW), the mscorlib acts as the COM Server. The .NET runtime creates exactly one CCW for a managed object, regardless of the number of COM clients requesting it. Multiple COM clients can hold a reference to the CCW, which in turn, holds a single reference to the underlying managed object.
|
|
|
|
|
Agreed. But the Winform application does not use the libraries through COM server.
WinForm App
|- Library1.dll
|- Library2.dll
.
Excel
|-ComWrapper
|-Library1.dll
|-Library2.dll
I have tried to explain the current situation digramatically. In the above case two instances of Library1.dll and library2.dll will be created as they are called from different processes. I need to have just one instance of library1.dll and library2.dll in the memory.
|
|
|
|
|
Looks like an outproc COM server. That is your programs would communicate with a .exe instead of loading a .dll.
|
|
|
|
|
><<a href=""></a>[<a href="" target="_blank"></a>]
<small></small>
|
|
|
|
|
You might want to edit your question, and look at the text: it is showing as:
><<a href=""></a>[<a href="" target="_blank"></a>]
<small></small>
Which is not particularly helpful...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
sujtha wrote:
Is there any open source library C#/C++/C which will give me the delta changes of file (it can be any type)?
Which OS are you targeting? There's a few possibilities getting .Net/rsync to play together.
GitHub has a few rsync APIs built in/for C#:
https://github.com/MatthewSteeples/rsync.net[^] (uses native System.IO)
https://github.com/kolosy/rsync.net[^] (uses pinvoke for filesystem calls)
You could also use System.Diagnostics.Process to invoke rsync and control its process from within your application. You can trap its i/o streams for analysis to get your results.
If you're looking for a C/C++ API, you could check rsync's site to see what's available, but it's going to require a Linux/Unix environment to compile and run. The Windows rsync fork comes packaged with some cygwin DLLs to meet this requirement.
|
|
|
|
|
Hello.
I have these 2 small functions that work together to decrypt a small amount of data, that is also of fixed length, a byte array of length 15;
Does anyone know if it could be re-written for c#?
I have tried a few things but to no avail, for example, I do not know what memset() does, so do not know what to do in place within c#.
I do not want to use some large crypto library, and the reason for this small function is so that the encrypted data is the exact same length of the original data, 15 bytes.
So, here is the code....and thank you.
void DecryptInstID(unsigned char *InstID)
{
unsigned char *Left, *Right;
unsigned char Aux[8];
int i, k;
Left = InstID;
Right = InstID + 8;
for (i = 0; i < 4; i++)
{
KeyedHash(Left, Aux);
for (k = 0; k < 8; k++)
Aux[k] ^= Right[k];
memcpy(Right, Left, 8);
memcpy(Left, Aux, 8);
}
}
void KeyedHash(unsigned char *Data, unsigned char *Result)
{
SHA_CTX Context;
unsigned char Digest[20];
static unsigned char Key[4] =
{
};
SHA1_Init(&Context);
SHA1_Update(&Context, Data, 8);
SHA1_Update(&Context, Key, 4);
SHA1_Final(Digest, &Context);
memcpy(Result, Digest, 8);
}
Thank you!
Regards,
Stephen
|
|
|
|
|
The .NET library has an implementation of SHA1 that you could use.
MSDN link: SHA1[^]
|
|
|
|
|
Thank you,
I was looking at that, however, I can not seem to find any way of using a key.
In the c++ code that I posted, it used SHA1 with a 4 byte key, and the decryption routine is a simple proprietry four-round feistel cipher.
I simply need to encrypt/decrypt the fixed length of bytes, without the output growing or changing in size.
The SHA1, apparantly, adds a higher level of security when used with the key.
Any Ideas?
Thank you,
Stephen
|
|
|
|
|
As far as I can understand from the code (and what I know from SHA1, which is a hashing algorithm), the actual SHA1 implementation doesn't use a key (can't use a key).
What happens in your C++ code is that you add the key as part of the 12 byte datablock-to-be-hashed: first 8 bytes of input data, then appended with a 4 byte constant key. You can just do the same in C# as you did in C++.
I admit I don't understand the actual algorithm you are using, but all you need to do is translate the code 1-to-1 from C++ to C#. The SHA1_* functions can be replaced with the SHA1 implementation (such as SHA1Managed) and the rest is almost directly valid C# code already.
About the memset function, it takes 3 parameters, memset(destination, value, countInBytes) and sets the first countInBytes bytes of destination to value.
memcpy(destination, source, count) copies count bytes from source to destination.
The algorithm itself is a bit funky with the memcpy's... It assumes a 16 byte InstID, but I guess that's alright?
|
|
|
|
|
Hi.
I have tried everything and just can't get it to work...
This is the code I have, but I am unsure how to replace the memcpy code for c#
Either way, it neither encrypts nor decrypts.
byte [] EncryptLicenseKey(byte[] licenseKey)
{
byte[] final = new byte[14];
byte[] left = new byte[14];
byte[] right = new byte[14];
byte[] Aux = new byte[14];
int i, k;
left = licenseKey;
right = licenseKey;
for (i = 0; i < 4; i++)
{
KeyedHash(left, Aux);
for (k = 0; k < 8; k++)
Aux[k] ^= right[k];
}
return Aux;
}
void KeyedHash(byte[] Data, byte[] Result)
{
byte[] Key = {0xff, 0xff, 0xff, 0xff};
HMACSHA1 mac = new HMACSHA1(Key);
Result = mac.ComputeHash(Data);
}
Still just trying to be able to pass a fixed length byte array and encrypt/decrypt it so that the output is EXACTLY the same length as the data we passed in, and use the key...
If you can help any further I will be very happy indeed
Thank you very much,
Regards,
Stephen
|
|
|
|
|
Sorry, I had forgotten for a second that C# doesn't support pointers anymore (at least, not 'normally' - only in unmanaged cases can you still use them).
I don't have the IDE in front of me at the moment, but I think this should work: the pointers are replaced by indices and the memcpy's are replaced by Array<byte>.Copy.
void DecryptInstID(byte[] InstID)
{
byte[] Aux = new byte[8];
int i, k;
for (i = 0; i < 4; i++)
{
KeyedHash(InstID, Aux);
for (k = 0; k < 8; k++)
Aux[k] ^= InstID[k + 8];
byte[].Copy(InstID, 0, InstID, 8, 8);
byte[].Copy(Aux, InstID, 8);
}
}
|
|
|
|
|
Thank you for taking the time to write some code, however...
MicroVirus wrote: byte[].Copy(InstID, 0, InstID, 8, 8);
byte[].Copy(Aux, InstID, 8);
I get an error telling me that "Invalid expression term byte" and the [] is highlighted as causing the error?
Thank you,
Stephen
|
|
|
|
|
Hmmm, yeah I was doubting about that :P Replace byte[] with Array<byte> and that should fix it, I think.
|
|
|
|
|
Hi.
Instead I used the following, and that worked...
System.Array.Copy(licenseKey, 0, licenseKey, 8, 8);
But the code still wont work, and I get an out of bounds/index error from this line:
Aux[k] ^= right[k + 8];
I know that in the c++ version, the original data and the encrypted data are exactly the same length, and when I used the other function it worked OK. So I can only presume it is trying to grow the original data array, which I would not want.
So, I am still stuck with this one and it is driving me insane.
Thank you for your help so far though, it is appreciated!
Steve
|
|
|
|
|