|
It can't be done the way you want. You have no choice but to use reflection as was demonstrated.
|
|
|
|
|
Hi..
Im new for windows applications.. i hav one doubt.. Im using vs 2005 and sql server 2005 Sqlexpress.. i need to get backup & Restore Databases..
im trying and got it through c# code (using smo). After successfully im create exe in my application and run client machine.. client machine have some project with DB..(DB mdf and log file Path is c:\test1\test2\test3) i want to get client machine DB backup Restore..But client machine installed only express edition not a management studio..
in this case how to get DB backup and restore in client machine..
Pls help me.. wat can i do..?
|
|
|
|
|
Sivaooty wrote: in this case how to get DB backup and restore in client machine..
Pls help me.. wat can i do..?
You'd need to distribute the appropriate files. There's a convenient package here[^] I are Troll
|
|
|
|
|
Hello friends,
I've an application which requires the interception of the network communication functions like send() & recv() and to get the data of these functions. Can anybody please provide the link for the source code on how to achieve this in C#.
Thanks in Advance.ritz1234
|
|
|
|
|
i searched no this to set the time out , i found that there is no such method and by default it waits 15 seconds, and i saw a sample using a timer , but need to know a better solution for this , is any idea ?
|
|
|
|
|
Using asynchronous methods and a timer is pretty much how you do it. If you aren't happy with that then you could create a wrapper class that hides all of the details and offers a Connect(address, port, timeout) method to make things easier for yourself.
|
|
|
|
|
|
i have obtained all the open connections in local machine , now i want the user to select connection that he wants to disconnect , so the problem is how can i end a connection from my application
|
|
|
|
|
First, you don't. Doing so would more than likely cause the app that opened it to crash.
|
|
|
|
|
sallam jojoba
منم عسل هر وقت اومدي پيغام بده چت كنيم
|
|
|
|
|
You have been told before. English!
كنت قد صرح من قبل. الإنجليزية! I know the language. I've read a book. - _Madmatt
|
|
|
|
|
به شام چه دخالت ميكنيد تو كار مردم
|
|
|
|
|
i googled for this and came up with only visual basic code not c#
I'm sure that i had to somehow make an event handler for this but unfortunately for me i'm too new to understand how to do this
|
|
|
|
|
By click you mean when a tab is selected? Use the SelectedIndexChanged[^] event I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Code :
public static uint GetUintFrombyte(byte[] ByteArry)
{
string Array = ByteArray.ToString(); /OR/ string Array = BitConverter.ToString(ByteArray);
int Value = int.Parse(Array, NumberStyles.HexNumber);
uint Value2 = Value;
return Value2;
}
Now here i read 4 bytes
Binary reader : byte[] Hex = br.ReadBytes(4);
Hex Now ='s 00000001
00000001 to a int value should = 1 then transfering it to a uint , but it isnt seemingly doing it .
Error comes up as on int value "Error : Invalid Format "
Any Help ?
Thanksmodified on Sunday, February 7, 2010 11:58 PM
|
|
|
|
|
I solved it , Here is the code :
(new Class)
public static string HexToAscii(byte[] hex)
{
string ascii = "";
for (int i = 0; i < hex.Length; i++)
{
string temp = hex[i].ToString("X");
if (temp.Length == 1)
temp = "0" + temp;
ascii += temp;
}
return ascii;
}
public static uint BytetoUint(byte[] Data)
{
string Array = Conversions.HexToAscii(Data);
int i = int.Parse(Array, NumberStyles.HexNumber);
return Convert.ToUInt32(i);
}
|
|
|
|
|
That is some terrible code.
xEvOx wrote: public static string HexToAscii(byte[] hex)
bad method name, nothing is hex unless it is a string holding the hex representation of something.
should be ToHexString(byte[] bytes)
xEvOx wrote: string temp = hex[i].ToString("X");
if (temp.Length == 1)
temp = "0" + temp;
use ToString("X2") to always get at least two characters
xEvOx wrote: string ascii = "";
in /NET all strings use Unicode, not ASCII.
xEvOx wrote: public static uint BytetoUint(byte[] Data)
another bad method name, it does not convert a byte, in converts a byte array.
and a very inefficient way to do things: you have numbers in the byte array, turn them into a string in order to extract a numeric value. One should never do that, just work with the numbers themselves, something like (untested):
public static uint ToUint(byte[] bytes) {
uint result=0;
foreach(byte b in bytes) result=(result<<8) | b;
return result;
}
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]
|
|
|
|
|
Just wondering why this block of code will not clear out databound textboxes that are inside a tab control that is grouped inside a groupbox?
private void add_Button_Click(object sender, EventArgs e)
{
foreach (Control c in this.Controls)
{
if (c is TextBox)
(c as TextBox).Clear();
if (c is CheckBox)
(c as CheckBox).Enabled = false;
}
}
I'm trying to reproduce the same type effect of when the add button is pressed on the tool strip. thanks
How I got it to work if anyone is interested:
private void add_Button_Click(object sender, EventArgs e)
{
bindingNavigator2.BindingSource.AddNew();
}
I just simply had to call the addnew() method on the bindingnavigators bindingsource to put it in add record state.
Thanks to all that helped me with this issue I really appreciate it.modified on Friday, February 12, 2010 10:29 PM
|
|
|
|
|
Controls can be nested, a TabPage resides in a TabControl which could be directly in a Form, or in a Panel inside a Form, or ...
So in order to do something to all children in a Form's Control hierarchy, in general one needs a recursive method (not when the hierarchical structure is known and fixed).
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]
|
|
|
|
|
If the textboxes are databound then you need to modify the datasource that is used to populate them. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thank you that makes since...
|
|
|
|
|
Hi all,
I have a task to do, it is about convert/upgrade an existing VB6 application into c#.
I heard it is a hard task to convert VB6 to vb.net furthermore i have to convert it to c# . I found some tools which can straight away converts the vb6 application to c#, but based on some reviews, It is addressed that the method is sluggish.
my question is, Is it possible for me to convert/upgrade it manually? is it recommended? If so, can anyone provide tutorials or any help regarding this topic. any suggestions, ideas,
solutions and etc will be deeply appreciated..
thank you.
Best Regards,
A.Kogulakannan
|
|
|
|
|
I wouldn't even try to convert the existing VB6 code. There is a vast difference in the tools and technologies that it would be better to rewrite the application so you could take advantage of them. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You need to totally rewrite the application, any attempt to convert VB6 to c# is going to require so much manual intervention you might as well rewrite from scratch and implement the latest technologies and concepts that were not even available when the app was written.
Besides, EVERY app can benefit from a rewrite!Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Guys,
I can't believe this is hard. I'm trying to read/write the 64-bit registry from a 64-bit c# application where the project options have x64 for the platform target. I've seen how to access the 32-bit registry using Microsoft.Win32 but there doesn't seem to be a 64-bit equivalent. Of course, with platform target set to x64, a reference to Microsoft.Win32 isn't available.
What am I missing?
TIA,
Steve
|
|
|
|