|
Please Don't Delete Any message
|
|
|
|
|
Abhijit Jana wrote: Please Don't Delete Any message
There are no such thing as stupid questions, only stupid people, right?
|
|
|
|
|
leppie wrote: There are no such thing as stupid questions, only stupid people, right?
Nope. I'm pretty sure that there are stupid questions. My wife keeps me well informed when she thinks I hit the mark.
|
|
|
|
|
I'm using XP and I can't search eventlogs for a specific string like vista.
is there any tool to do that?
|
|
|
|
|
From Eventviewer -> View -> Filter, you can filter Data.
If you want search String, you can create your custome Tool. and i thing that you can do with some Effort.
|
|
|
|
|
hello does someone know how to put a code in one of the treeview nodes???
i want every nodes to open differennt window forms..
how can i do it??
please some sample codes.. i really appreciate it,
ginji
|
|
|
|
|
Well, I assume the nodes have a tag property. You could set that, handle the selected node changed event, check the tag and based on that, open a form.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi ginji
do not Cry too much its not good for ur health and it never make you a good developer.
check the tree node events there is event call on node click in this event
<br />
<br />
if(e.Node ==Name of the Node)<br />
{<br />
Form2 obj = new Form2();<br />
obj.Show();<br />
<br />
}<br />
wasim khan
|
|
|
|
|
i want the flag true in if condition c the if condition and c the comments plz thx
just put a button on form and past those methods
private void button2_Click(object sender, EventArgs e)
{
CheckRegistration("your email here@any.com", "your reg code here");
}
public bool CheckRegistration(string _regMail, string _regCode)
{
bool flag = false;
non = _regCode;
if (((_regMail.Length > 5) && (_regCode.Length > 7)) && GetRegCode(_regMail).Equals(_regCode))
{
flag = true;
int k = 0;
}
MessageBox.Show(flag.ToString());
return flag;
}
private static int ConvReg(char _c)
{
int num = 0x2a;
char[] chArray = new char[] {
'q', '1', 'c', 'a', 'x', 'l', '-', '7', 'u', 'd', '3', 'b', '2', '9', 'n', 'g',
'f', 'v', 't', 'j', 'k', '5', 'm', 'e', 'o', 'p', '6', '@', 's', 'i', '8', 'h',
'w', '4', 'y', '_', '0', 'r', '.', 'z'
};
for (int i = 0; i < chArray.Length; i++)
{
if (_c == chArray[i])
{
num = i;
}
}
return num;
}
public static string GetRegCode(string _regMail)
{
string str = "2X";
if (_regMail.Length > 5)
{
char[] chArray = _regMail.ToLower().ToCharArray();
int index = _regMail.IndexOf("@");
str = (((str + ConvReg(chArray[0]).ToString()) + ConvReg(chArray[1]).ToString() + ConvReg(chArray[index - 1]).ToString()) + _regMail.Length.ToString() + ConvReg(chArray[index + 1]).ToString()) + ConvReg(chArray[index + 2]).ToString() + ConvReg(chArray[_regMail.Length - 1]).ToString();
}
return str;
}
its me yami
now cheers
|
|
|
|
|
I am at a loss to understand what you're asking. Which bit of code do you have a problem with ?
If the mail address and code are long enough, then the input to the program determines if it's true or not. We can't make it true in code, without short circuiting the logic that checks if it should be true.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
theredonion wrote:
Christian Graus wrote:If the mail address and code are long enough, then the input to the program determines if it's true or not. We can't make it true in code, without short circuiting the logic that checks if it should be true.
how to do short circuit. i just want those parameters which can make if condition true is it posible please help me!
like if i send parameters (myemail@yahoo.com,abc123); if this makes the if condition true then i need these parameters how it posible or which parameters should i send which make the if condition true thx
its me yami
now cheers
Reply to the forums, don't email me.
Did you not write this code ? I'm assuming now that you've used reflection to read the registration code for a piece of software you want to steal, and you can't work out how to reverse engineer this process to do it.
If you wrote the code, then you should know how to create codes that work with it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,
i am print concept to print the dtagrid rows.....
i am using c# coding......
while taking the print i am getting output as(givn below)....
Pepsi 500ml £1.09
coke 500ml £1.09
Fanta 500ml £1.09
Sprite 500ml .99p
but my uotput should be like the given below......
Pepsi 500ml £1.09 coke 500ml £1.09
Fanta 500ml £1.09 Sprite 500ml .99p
tell me where i have to change my coding paart:
my coding is;
public class DataGridPrinter
{
private PrintDocument ThePrintDocument;
private DataTable TheTable;
private DataGridView TheDataGrid;
public int RowCount = 0; // current count of rows;
//private const int kVerticalCellLeeway = 10;
public int PageNumber = 1;
public ArrayList Lines = new ArrayList();
int PageWidth;
int PageHeight;
int TopMargin;
int BottomMargin;
public DataGridPrinter(DataGridView aGrid, PrintDocument aPrintDocument, DataTable aTable)
{
//
// TODO: Add constructor logic here
//
TheDataGrid = aGrid;
ThePrintDocument = aPrintDocument;
TheTable = aTable;
// TheTable.Columns.RemoveAt(3);
PageWidth = 350;
TopMargin = 30;
// PageWidth = ThePrintDocument.DefaultPageSettings.PaperSize.Width;
PageHeight = ThePrintDocument.DefaultPageSettings.PaperSize.Height;
//TopMargin = ThePrintDocument.DefaultPageSettings.Margins.Top;
//TopMargin = 100;
BottomMargin = ThePrintDocument.DefaultPageSettings.Margins.Bottom;
}
public void DrawHeader(Graphics g, int ff)
{
//SolidBrush ForeBrush = new SolidBrush(TheDataGrid.HeaderForeColor);
//SolidBrush BackBrush = new SolidBrush(TheDataGrid.HeaderBackColor);
//Pen TheLinePen = new Pen(TheDataGrid.GridLineColor, 1);
StringFormat cellformat = new StringFormat();
cellformat.Trimming = StringTrimming.EllipsisCharacter;
cellformat.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
int ht = ff + 2;
int columnwidth = 30;
int initialRowCount = RowCount;
// draw the table header
//float startxposition = TheDataGrid.Location.X;
float startxposition = 30;
RectangleF nextcellbounds = new RectangleF(0, 0, 0, 0);
RectangleF HeaderBounds = new RectangleF(0, 0, 0, 0);
HeaderBounds.X = TheDataGrid.Location.X;
HeaderBounds.Y = TheDataGrid.Location.Y + TopMargin + (RowCount - initialRowCount) * (TheDataGrid.Font.SizeInPoints + ht);
HeaderBounds.Height = TheDataGrid.Font.SizeInPoints + ht;
HeaderBounds.Width = PageWidth;
//g.FillRectangle(BackBrush, HeaderBounds);
for (int k = 0; k < TheTable.Columns.Count; k++)
{
string nextcolumn = TheTable.Columns[k].ToString();
//Command Line
//RectangleF cellbounds = new RectangleF(startxposition, TheDataGrid.Location.Y + TopMargin + (RowCount - initialRowCount) * (TheDataGrid.Font.SizeInPoints + kVerticalCellLeeway),
// columnwidth,
// TheDataGrid.HeaderFont.SizeInPoints + kVerticalCellLeeway);
//nextcellbounds = cellbounds;
//if (startxposition + columnwidth <= PageWidth)
//{
// g.DrawString(nextcolumn, TheDataGrid.HeaderFont, ForeBrush, cellbounds, cellformat);
//}
//startxposition = startxposition + columnwidth;
//Command LIne
}
//if (TheDataGrid.GridLineStyle != DataGridLineStyle.None)
//g.DrawLine(TheLinePen, TheDataGrid.Location.X, nextcellbounds.Bottom, PageWidth, nextcellbounds.Bottom);
}
public bool DrawRows(Graphics g, int fz)
{
int lastRowBottom = TopMargin;
int hh = fz + 60;
try
{
SolidBrush ForeBrush = new SolidBrush(TheDataGrid.ForeColor);
SolidBrush BackBrush = new SolidBrush(TheDataGrid.BackColor);
//SolidBrush AlternatingBackBrush = new SolidBrush(TheDataGrid.AlternatingBackColor);
//Pen TheLinePen = new Pen(TheDataGrid.GridLineColor, 1);
StringFormat cellformat = new StringFormat();
cellformat.Trimming = StringTrimming.EllipsisCharacter;
cellformat.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit;
//int columnwidth = PageWidth/TheTable.Columns.Count;
int columnwidth = (PageWidth / TheTable.Columns.Count);
//columnwidth = 100;
int initialRowCount = RowCount;
RectangleF RowBounds = new RectangleF(0, 0, 0, 0);
// draw vertical lines
Font printFont = new Font("Arial", fz);
// draw the rows of the table
for (int i = initialRowCount; i < TheTable.Rows.Count; i++)
{
DataRow dr = TheTable.Rows[i];
int startxposition = TheDataGrid.Location.X;
//startxposition = 20;
RowBounds.X = TheDataGrid.Location.X;
RowBounds.Y = TheDataGrid.Location.Y + TopMargin + ((RowCount - initialRowCount) + 1) * (TheDataGrid.Font.SizeInPoints + hh);
RowBounds.Height = TheDataGrid.Font.SizeInPoints + hh;
RowBounds.Width = PageWidth;
Lines.Add(RowBounds.Bottom);
if (i % 2 == 0)
{
g.FillRectangle(BackBrush, RowBounds);
}
else
{
//g.FillRectangle(AlternatingBackBrush, RowBounds);
}
for (int j = 0; j < TheTable.Columns.Count; j++)
{
RectangleF cellbounds = new RectangleF(startxposition,
TheDataGrid.Location.Y + TopMargin + ((RowCount - initialRowCount) + 1) * (TheDataGrid.Font.SizeInPoints + hh),
columnwidth,
TheDataGrid.Font.SizeInPoints + hh);
//200 + kVerticalCellLeeway);
if (startxposition + columnwidth <= PageWidth)
{
g.DrawString(dr[j].ToString(), printFont, ForeBrush, cellbounds, cellformat);
lastRowBottom = (int)cellbounds.Bottom;
}
startxposition = startxposition + columnwidth;
}
RowCount++;
if (RowCount + 1 * (TheDataGrid.Font.SizeInPoints + fz) > (PageHeight * PageNumber) - (BottomMargin + TopMargin))
{
DrawHorizontalLines(g, Lines);
//DrawVerticalGridLines(g, TheLinePen, columnwidth, lastRowBottom);
return true;
}
}
DrawHorizontalLines(g, Lines);
//DrawVerticalGridLines(g, TheLinePen, columnwidth, lastRowBottom);
return false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
}
void DrawHorizontalLines(Graphics g, ArrayList lines)
{
//Pen TheLinePen = new Pen(TheDataGrid.GridLineColor, 1);
//if (TheDataGrid.GridLineStyle == DataGridLineStyle.None)
return;
for (int i = 0; i < lines.Count; i++)
{
// g.DrawLine(TheLinePen, TheDataGrid.Location.X, (float)lines[i], PageWidth, (float)lines[i]);
}
}
void DrawVerticalGridLines(Graphics g, Pen TheLinePen, int columnwidth, int bottom)
{
//if (TheDataGrid.GridLineStyle == DataGridLineStyle.None)
return;
for (int k = 0; k < TheTable.Columns.Count; k++)
{
g.DrawLine(TheLinePen, TheDataGrid.Location.X + k * columnwidth,
TheDataGrid.Location.Y + TopMargin,
TheDataGrid.Location.X + k * columnwidth,
bottom);
}
}
public bool DrawDataGrid(Graphics g, int ff)
{
try
{
DrawHeader(g, ff);
bool bContinue = DrawRows(g, ff);
return bContinue;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
}
}
|
|
|
|
|
Wow.
I assume your datagrid does not display this way on the form, right ?
cse.vidhya wrote: for (int i = initialRowCount; i < TheTable.Rows.Count; i++)
{
DataRow dr = TheTable.Rows[i];
int startxposition = TheDataGrid.Location.X;
What do you think this will do ? I'm suspecting it will create a new row to be printed for every row in your data set. So, it sounds like you want to change i++ to i+=2, read two rows every time, and draw them next to each other.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i gave i++ to 1+=2
but i am getting only 1st row and 3rd row .. and the 2nd row and 4th rows are not coming..
i need all the rows while printing like below
Printed out should be like
Pepsi 500ml £1.09 coke 500ml £1.09
Fanta 500ml £1.09 Sprite 500ml .99p
|
|
|
|
|
Like I said, you plain do not understand your own code.
As I said, going to i+=2 means that you're not starting a new row for every item. Now you need to add code to draw every second item on the same row, or you will plainly get every second item only printed.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Can you please refer me to a website where I can follow an asp.net 3.5 case study from start to finish?
I have searched msdn but have not found anything yet.
Thanks
|
|
|
|
|
Check here [^]
This is C# Forum Please Post it Asp.net Forum
|
|
|
|
|
|
Wondering if anyone has a state machine diagram on how regular expressions accomplish there job?
This way i can trace the diagram given a pattern and string input.
Regex.IsMatch
Regex.Replace
Regex.Split
just for learning purposes since i want to move deeper into interpretors and compilers. I already know how to implement regex in practice.
|
|
|
|
|
The book 'mastering Regular Expressions' from O Reilly has big chapters on how it all works internally.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi, I am new to c#, but I am a vb.net programmer. I have a line
strLastServer = drowData["ServerName"].ToString;
where strLastServer is declared
string strLastServer = "";
I am getting an error on build:
Cannot convert method group 'ToString' to non-delegate type 'string'. Did you intend to invoke the method?
I looked at an article on this site which seemed to suggest what I was doing was OK, but....
What am I doing wrong?
|
|
|
|
|
In C# method calls should have parathesis/()...
You will get used to it very soon
strLastServer = drowData["ServerName"].ToString();
Software - Bundle of bugs covered with features.
|
|
|
|
|
So simple - and I have been racking my brain for hours. Thanks a million!
|
|
|
|
|
public class UserSettings
{
public UserSettings[]
{
}
}
so that I can access it like so:
Console.WriteLine(UserSetting["ITEMNAME"]);
Thank you to everyone in advance.
QMuffs
|
|
|
|
|
What are you trying to accomplish?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|