|
but the same code is running successfully on other PC.
Why not on this?
Now How to fix it finally,
Is there any other way, I can replace the innertext of an htmlelement
|
|
|
|
|
Do you use the same input (I guess a HTML-page) at every PC?
|
|
|
|
|
yes, the only difference is in the PC which has visualStudio, it is successfully sets the innerText Value of an HTMLElement.
I don't understand where I'm doing wrong?
|
|
|
|
|
Is it possible, that you could post a bit more of your code, e.g. the point where you get the elements from etc. Maybe this will guide us to the point of failure...
|
|
|
|
|
|
Hi Dears,
Kindly let me know the definition of NON-BLOCKING Socket. "in short"
Thank you in advance
(Riaz)
|
|
|
|
|
M Riaz Bashir wrote: Kindly let me know the definition of NON-BLOCKING Socket.
NON-BLOCKING Socket
|
|
|
|
|
Hi
I make any File in PC, and I transfer him to PPC (Windows mobile)
How I can get the Modified date of this file ?
I try this:
DateTime GG;
FileInfo H = new FileInfo(@"c:\License.txt");
GG = H.CreationTime;
GG = H.LastWriteTime;
GG = File.GetCreationTime(@"c:\License.txt");
GG = File.GetLastAccessTime(@"c:\License.txt");
GG = File.GetLastWriteTime(@"c:\License.txt");
but I always get the Today date and time
thank's in advance
|
|
|
|
|
Yes the output is correct!!
because you have transferred the file only today!!! so that is the latest write time!!!
Have a Happy Coding.....
|
|
|
|
|
thank's for the help
What I can do to see the real creation date of the file ?
|
|
|
|
|
That is quite difficult to do AFAIK!
You can try implement this logic with the corresponding code!
1.Before File Transfer operation to your mobile device
--------------> copy the present Created Time, LastWrite time and lastAccess time to a temporary variable!
2.Copy the File!
3.And reset the Created Time, LastWrite Time and LastAccess Time from your temporary variable! since these are properties, you can able to set them! i believe!!!
So if your copy function performs all this three steps, then you will always get the creation date of file as same as your computer!!!!
It may work!!!
Have a Happy Coding.....
|
|
|
|
|
Hay..
I hava a windows based c# application project.. which i hav to switch to Arabic when user select arabic option when login.....
help pls
|
|
|
|
|
|
pls, i need code that will generate numbers,from 1 to 40 per row without repeatition.
It must generate the numbers without repeating any number in a row and any row must not repeat it self in the table. so it will generate all possible numbers per rows,in such a way that if i write down numbers 1 to 40 numbers randomly without reapeting any number row, i must find it in the one i generate from the winform gui and C# code.And another button will be able to print preview the table.
[confused]
thanks for ur assistance.
OLUMADE DAMILARE
|
|
|
|
|
Winforms has nothing to do with it.
The way to get a sequence without repeats is, you fill a list with the numbers 1-40. Then you use a random number generator to pick a number out of that sequence. Then you remove thant number. So, the second time, you need a number between 0 and 38 ( because the sequence is 0 indexed ). So, every time you generate a result, you remove it from the possible result pool.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ah, there you are, I figured you'd show up eventually.
See here[^].
However, if you want several unique sequences of the same values, you may need to go a step further.
Add:
As you're generating a sequence, make a base-40 string of it. Have a HashSet<string> to hold the sequences you've already generated. If the sequence is a duplicate, try again; if not, add it to the HashSet and return it.
You can generate a base-40 digit with "0123456789ABCDEFGHIJKLMNOPQRSTUVQXYZabcd" [ i ] and append it to a StringBuilder .
modified on Sunday, July 26, 2009 8:37 PM
|
|
|
|
|
Hello,
I want to get the unicode of some chars to send them to a cellphone
EX:
0628 represnt the char 'ب' in Arabic iwant to get this 0628 from this letter.
thanks
Dad
|
|
|
|
|
For each character in the string this displays:
The character
It's unicode character code in hex
It's unicode character code number
string text = "0 a+…"";
foreach (char c in text)
{
Console.WriteLine("{0} U+{1:x4} {2}", c, (int)c, (int)c);
}
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Chars already are in unicode
|
|
|
|
|
My Question,
I have designed FORM1 with a datagridview dgvForm1 and am populating data into it using LINQ queries. The data is populating fine into the dgvForm1.
I have a checkbox column in the dgvForm1 to select the checked rows.
I have a button in FORM1 called DISPLAY.
I have FORM2 with datagridview dgvForm2.
All I want to do is ...allow the user to select the required rows from dgvForm1 using checkboxs. After selecting, the user clicks on the DISPLAY which will show FORM2 . I want to display the selected rows from dgvForm1 in the datagridview(dgvForm2) of FORM2.
Am using C# with VS 2008 , this my code for reading the checked value of rows,,,, I have defined a constructor in Form2 to take in string values. Then in form2 initialization am assigning the string value to datagridview2 in form 2.. Am not sure if its correct to do so ..... but am not getting the required result.i.e my datagrid2 is not getting populate with the checked rows from datagrid1. please suggest solutions,,,thanks
string<br />
<br />
data = string.Empty;<br />
foreach (DataGridViewRow row in dataGridView1.Rows<br />
{<br />
if (row.Cells[SelectColumnIndex].Value != null &&<br />
Convert.ToBoolean(row.Cells[SelectColumnIndex].Value) == true)<br />
{<br />
foreach (DataGridViewCell cell in row.Cells)<br />
{<br />
if (cell.OwningColumn.Index != SelectColumnIndex)<br />
{<br />
data += (cell.Value + ","); <br />
}<br />
}<br />
data += "\n";<br />
}<br />
}<br />
Form2 fm = new Form2(data);<br />
fm.Show();<br />
<br />
}<br />
<br />
<br />
public Form2(String data) <br />
<br />
{<br />
<br />
InitializeComponent();<br />
<br />
this.dgv1Fm2.DataSource = data; <br />
<br />
<br />
<br />
<br />
<br />
}<br />
<br />
|
|
|
|
|
I would suggest an alternative strategy.
Instead of a string for your data member use a List<> .
Then for each selected row add the primary index value to the List<>.
Pass the data to Form2, in the constructor, as you do now and then load data into the dgv using a SELECT statement, passing in the items from the List<> as parameters for a WHERE clause.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Is there any easier way....to display selected data from form1 dgv using checkbox...and diaplay in dgv of form2
|
|
|
|
|
spankyleo123 wrote: Is there any easier way
Depends on what you call easy!
It also depends on what you want to do with the data in Form2. If it is read only then you could create a class (I'll refer to it as SelectedData ) that has fields for each of the columns of interest from your data, give it a Constructor that takes a DataGridViewRow and load the fields from the dgvRow in the Constructor .
You could then go through your dgv and for each selected row create an instance of SelectedData with the DataGridViewRow and add it to a List<selecteddata>.
Pass the filled List to Form2 and simply set dgvForm2.DataSource to the List<>.
If you need to edit the data in Form2, my previous suggestion, or a variation of it, would be preferable.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi
I am trying to take screenshots from DirectX Games and I successfully take screenshots most of the time. But sometimes my screenshots come out completely black.
Here is the code I am using to take screenshot:</b>
int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);
A global solution to take screenshots would be great (for desktop - for DirectX and OpenGL games).
Thank you.
|
|
|
|
|
How can i insert to list/array an object to the right place by some comparison function and in the end of the process to get back the best 100 object?
for example if i have this code:
<br />
class Example : IComparable<br />
{<br />
public double num1;<br />
public double num2;<br />
public double GetIt<br />
{<br />
get<br />
{<br />
return num1 * num2;<br />
}<br />
}<br />
<br />
public double SomeValue()<br />
{<br />
double result = this.num1 * this.num2 - this.num1 / (this.num2 + 1);<br />
return result;<br />
}<br />
<br />
#region IComparable Members<br />
<br />
public int CompareTo(object obj)<br />
{<br />
Example e1 = (Example)obj;<br />
int res = (this.SomeValue() - e1.SomeValue()) > 0 ? 1 : -1;<br />
return res;<br />
}<br />
<br />
<br />
#endregion<br />
}<br />
<br />
class UsingExample<br />
{<br />
public List<Example> m_List;<br />
<br />
public UsingExample()<br />
{<br />
m_List = new List<Example>();<br />
for (int num1 = 1; num1 <= 100; num1++)<br />
for (int num2 = 1; num2 <= 100; num2++)<br />
{<br />
Example e1 = new Example();<br />
e1.num1 = num1;<br />
e1.num2 = num2;<br />
m_List.Add(e1);<br />
m_List.Sort();<br />
<br />
if (m_List.Count > 100)<br />
m_List.RemoveAt(100);<br />
}<br />
<br />
<br />
}<br />
public Example this[int num]<br />
{<br />
get { return this.m_List[num]; }<br />
}<br />
<br />
<br />
}<br />
<br />
The problem is that every time i need to sort all the list. What is the best way to do it in C# by this process:
1. Insert an object to Sorted Array/List in the right place.
2. If the Current Instance of an object is Smaller then the biggest object in the 100 small object list (by Some IComparable functions):
2.1 Remove the biggest object from the list.
by This process i want to remaine with the smallest object in 100 list.
what is the best way to do it because i don't want to sort the Array every iteration if the Array/List is allready sorted.
|
|
|
|