Yes, T will become the type that you pass but GetBytes can accept only 9 types. So either the type of T should be one of them or you should write a new class like that acts like bitconverter and has a function called GetBytes that accepts many types but that means quite a lot of work
Yes you can by adding the where clause and specifying the restriction you want to apply but I'm not sure if you can limit T to only those nine types. For the constraint that you can apply have a look at this: Types of generic constraints[^]
Out of bound question but here there may be some one who might be coped with the following
when ipress CTRl+ALT+DEl the comp says ur task manager has been disabled and in my tools drop down there is no folder options this is a virus what will be a spcific antivirus
I want to make a very basic rythm game in c#. What would be the best way to get the grahics to run in time with a music file? Some basic ideas of how it could be done would be great to get me started.
You obviously know what your talking about but sadly i had no idea ... any chance you could break it down a bit for me (which music file is best to use?, how do i find the beat durations? etc.)
I was thinking of having an editor and plotting the notes on a timeline ... saying that I dont think there would be another way to do it!
Thanks for your response
i retrive the image src from database and stored it in the array like this..
if (con.State != ConnectionState.Open) con.Open();
cmd.Connection = con;
cmd.CommandText = "select varImageSrc from mtblGallery";
ada.SelectCommand = cmd;
recCount = dt.Rows.Count;
string imgArray = new string[recCount];
for (i = 0; i < recCount; i++)
imgArray[i] = (dt.Rows[i].ToString());
if (con.State != ConnectionState.Closed) con.Close();
can anyone help.. its urgent.
My application is related to sockets and I m using threads in it.I closed sockets as well as threads but now still
Y I m getting this exception and how to remove this error
" Unhandled exception at 0x7c81eb33 in Playback1.exe: 0xE0434F4D: 0xe0434f4d."
plz help me out as soon as possible
Please if someone can explain if this can be done/how it is done :
I want my program to automatically click a link for a website and then save the file with the defualt program that is assigned to it.(not my program)
For example, if the user writes "nero", I enter a search site that I choosed before, and I want it to click the first result that comes from the website's search engine, and afterwards to click open. (for example in my computer if I click open it will be downloaded with flashget/azuereus depends)
simply go for the defualt.
You may want to use winapi calls to simulate user clicks, but it will be very strongly coupled with the browser you choose. Why don't you just open a connection with the search engine you are using, and talk to it as though you are the browser. That way, all the data will pass through your code with no middleman. Then if you want to display what you found, you can open a third party application at that time with the file you saved to the hard drive.
Here is an example to Simulating User Clicks. Just use the methods "GetWindowHandleWhoseTitleStartsWith" and "SimulateClick". The problem with this approach is that the external application must be active (I think) and visible (I think). Also, you develop a hard dependency between the location of buttons in your application and the third-party software, which is terrible practice. The alternative method I suggested is DEFINITELY the preferable way to do it, but I cannot give you an example because I have not used sockets or HTML communication in C#. Basically, the idea is that you would open a socket connection on the standard html port at the destination (probably some call like Socket s = new Socket("http:\\www.google.com", 54), send an html request to get the search page (probably like s.SendMessage(new HTMLRequest("http:\\www.google.com#searchstrings"))), then parse the return HTML to get the first link (see xmldocument or htmldocument), and finally load the data from that link into your own HTML browser. You will have to do some work to figure that out, but it will ALWAYS work and does not depend on third-party software (other than the search engine). Sorry I couldn't be more help in that arena.
private IntPtr m_Handle = IntPtr.Zero;
public delegate bool EnumWindowsProc(IntPtr handle, object data);
public extern bool EnumWindows(EnumWindowsProc proc, object data);
public extern int GetWindowText(IntPtr handle, StringBuilder title, int maxSize);
public static extern IntPtr SendMessage(IntPtr handle, uint op, uint keys, Point point);
You can initialize a variable of System.Threading.Timer in the OnStart method as set up event handler for Elapsed event. In the event handler call the stored procedure using sqlcommand object and pass the parameter by adding it to Parameters collection
I want to copy one listview.item and change name on subitem by +1 if that exists add+1 and futher
Dictionary<string, int32=""> list = new Dictionary<string, int="">();
if (listView2.SelectedItems.Count > 0)
foreach (ListViewItem lvi in listView2.Items)
int number = Convert.ToInt32(lvi.SubItems);
bool alreadyExists = true;
alreadyExists = false;
foreach (int existingNumber in listView2.Items)
if (existingNumber == number)
alreadyExists = true;
number = number + 1;
it says: Unable to cast object of type 'ListViewSubItem' to type 'System.IConvertible'?
what should i do? sigh
Last Visit: 31-Dec-99 18:00 Last Update: 25-Sep-23 1:14