|
Anybody?
I feel the silence of the universe oppressing my code! oh nooooo!
|
|
|
|
|
The application i am working requires to export the datagridview to excel file. With help of some articles here i am able to do the needful.
But i am interested in getting more details about these.
will you plz suggest me a good book from where i can start and gather more knowledge about all this.
such as-
working with MS office files,
with pdf.
with xml files
regards
|
|
|
|
|
hi all, i use the following algorithms to encrypt then to decrypt a sequence of bytes, but the decryption algorithm always return an exception
<Length of the data to decrypt is invalid<
i don't know why that, both algorithms are below..,
public class CryptorEngine
{
static public byte[] keyArray;
static public byte[] resultArray;
public static void Encrypt(byte[] toEncryptArray, bool useHashing)
{
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
if (useHashing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
CryptorEngine.keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd5.Clear();
}
else
CryptorEngine.keyArray = UTF8Encoding.UTF8.GetBytes(key);
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tdes.CreateEncryptor();
CryptorEngine.resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
tdes.Clear();
}
}
public class DecryptorEngine
{
static public byte[] keyArray;
static public byte[] resultArray;
public static void Decrypt(byte[] toEncryptArray, bool useHashing)
{
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
if (useHashing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
DecryptorEngine.keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd5.Clear();
}
else
DecryptorEngine.keyArray = UTF8Encoding.UTF8.GetBytes(key);
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tdes.CreateDecryptor();
DecryptorEngine.resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
tdes.Clear();
}
}
regards..........;
|
|
|
|
|
Hi All,
Can you please help me for following situation
I Am creating C# application which allow multiple user to work on same XML file which is on server
can any one have solution
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
Why would you do that?
It's PAINFULL. There are many small/lite DBs around that would be more apropriate for this
like SQLLite, even the compact edition of SQL, or use a *.mdb/access.
All these are lot less painfull than using an XML with multi user.
|
|
|
|
|
you can solve this problem with set promotions to the users or set priorities to operations
|
|
|
|
|
Hi,
I have a small problem with Combobox Data binding.
I am binding data to combobox from database by using the following code.
SqlDataAdapter da1 = new SqlDataAdapter("select * from sampledb", con);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
cmbUnit.DataSource = ds1.Tables[0];
cmbUnit.DisplayMember = "UnitName";
After that I want to Insert New item to combobox by using the following code.
cmbUnit.Items.Insert(0, "Select");
But it is showing an error that "Item Collection can't be modified when the datasource property is set".
Can anyone please suggest me how to resolve that problem by using C# Combobox only.
Thanks&Regards
Pavani
|
|
|
|
|
Your combo is DataBound so it won't let you use the Items.Add() and others...
Couple of solutions:
1) Add it(the item) to the dataset(binding source) and refresh the combo.
2) Create a List of strings or whatever your combo dataset contains and than use:
comboBox1.DataSource = myList;
When you add an item to the list:
comboBox1.DataSource = null;
myList.Add("blah");
comboBox1.DataSource = myList;
|
|
|
|
|
Now I am watching the book, dragon book.
I want to know how to write a C# compiler, just only a simple compiler which can complie C# Hello world prgram.
Who can tell me how to do it?
|
|
|
|
|
See here[^].
It seems to be a good starting point.
|
|
|
|
|
thanks, I will see this aticle.
I try to write a hello world program using C#.
But I find that if not using the .net framwork, this C# program cannot run.
Perhaps, I will try to write a c or c++ compiler and then write this C# compiler.
|
|
|
|
|
How simple? What are you going to leave out? (unsafe code? arrays? return values? method arguments? nonstatic methods? local variables?)
It's actually not all that hard (compared to native languages), it's just a stack architecture so you don't need to worry about register allocation and the peculiarities of x86, and since the JIT compiler does a lot of optimizations anyway you can just skip all that (no SSA stage needed to get a reasonable output)
Hello World is just this (debug output, as MSIL in text):
.class private auto ansi beforefieldinit Program
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed
{
.maxstack 8
L_0000: ldarg.0
L_0001: call instance void [mscorlib]System.Object::.ctor()
L_0006: ret
}
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
.maxstack 8
L_0000: nop
L_0001: ldstr "Hello World!"
L_0006: call void [mscorlib]System.Console::WriteLine(string)
L_000b: nop
L_000c: ret
}
}
You could skip the nops.
|
|
|
|
|
Thanks for your reply.
I do not understand the .net framework architecture.
I know that the last code program is writed with Microsoft middle language. (Just as assmebly).
But I do not know how to compile the C# code to the MSIL and compile the MSIL to the exe file, in my compiler.
|
|
|
|
|
Fired.Fish.Gmail wrote:
I do not understand the .net framework architecture.
What do you mean, exactly?
Fired.Fish.Gmail wrote: But I do not know how to compile the C# code to the MSIL
The techniques you'd have to use depend on how many features of C# you want to include, for example if you'd have only a single expression you could just post-order dump your AST and be done with it, otherwise it takes more work but never really a lot (for a decent example you could look at the mono compiler)
Fired.Fish.Gmail wrote: compile the MSIL to the exe file
You could do it yourself (but it's not easy, especially the metadata tables), or use ilasm.exe (included in .NET framework), or use Reflection.Emit
|
|
|
|
|
hi,
im a internet webpage programmer developing a website able to control a remote computer using the internet,this website capable of shutdown logoff print screen and monitoring a target pc...
at my website side progrmaming everything is fine, it works as what i want to control a client pc but, since as i keep on revising my software for my client side, using c#, i need a windows form that will go to
minimize or mazimize in such case that once i command logoff the client windows screen will be intirely covered to whole pc screen by my form without border...
what i only need is a source code that control a form property using visual c# 2008..
www.q12w3.com/pc/
ric
|
|
|
|
|
|
is there any open source project which will help me to generate form with control automatically. suppose i have table in my database and i will
just point that table through a application and after that application will create store procedure, data access layer and also form with (frontend) everything. so later if require i will just change the auto generated code. if this type of application exist then please give me url.
Thanks in advance
tbhattacharjee
|
|
|
|
|
You can use an Open Source code-generator like MyGeneration[^]. There's an example of a UI-template at the bottom of this[^] page.
Good luck
I are Troll
|
|
|
|
|
I want to write a program like osk(on-screen keybroad) of windows, but i don't know how to generate a key press like click on button1->you click on the A button on the keybroad!
|
|
|
|
|
This[^] article might help you.
DoanDucTai wrote: i don't know how to generate a key press
It depends on your requirements.
You could use SendKeys[^] class.
Another option is using direct PostMessage[^] calls with WM_KEYDOWN and WM_KEYUP messages.
I hope this helps.
[EDIT]
Giorgi Dalakishvili have suggested a very useful input simulator in the post bellow.
I'd use the suggested library instead of SendKeys class or raw Windows API calls (like SendInput or PostMessage ).
[/EDIT]
modified on Wednesday, February 3, 2010 6:58 AM
|
|
|
|
|
|
hi,
i have written a multithreaded application using bgworker in which i m doing some task in dowork method..it is running fine in debug mode but not producing desired output when i run the application.wat can be the problem?
|
|
|
|
|
So what exactly fails in release mode?
If you post the part of the code that fails, it's much easier to help
|
|
|
|
|
could be race conditions, caused by a lack of synchronization (insufficient locks).
I can't tell without much more information about your app, and what exactly is going wrong (and how often, how consistently).
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Dear All,
I am using Asp.Net with C# in windows application (VS 2005). I create one test.bat file, which is executed by my application. I am using "System.Diagnostics.Process.Start" to execute test.bat. How can I get the result, that the bat file has been executed and closed.
Because, test.bat file is taking few seconds to run and it creates a table with data and gets closed. My application is gets the data from the table, which is done by test.bat and proceed further. I can have good result, if I debug the application. I can not have a good result at run mode.
I want to proceed my application, after executed the test.bat file. How can I identify that test.bat file has been executed fully?. What I need to do?. I have to handle threading? Is there any other way? Thanks in adv.
Balasubramanian K.
|
|
|
|