|
thai gayu barobar,arpita ne problem hato aa, ene mane call karyoto savare ne kidhutu, etle me post karyu tu.
Barobar thai gayu.
nekshan.
|
|
|
|
|
hi,
i have created an editor in c# now i want implement a feture called goto line number can any one help me?
thanks
|
|
|
|
|
if a process invokes a window say Notepad, Is it possible to know the coordinates of the window relative to the screen Coordinates???? If it is how?
|
|
|
|
|
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
class Program
{
[DllImport("User32", EntryPoint = "GetWindowPlacement")]
private static extern bool GetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);
private struct POINTAPI
{
public int x;
public int y;
}
private struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
private struct WINDOWPLACEMENT
{
public int length;
public int flags;
public int showCmd;
public POINTAPI ptMinPosition;
public POINTAPI ptMaxPosition;
public RECT rcNormalPosition;
}
static void Main(string[] args)
{
Process[] processes = Process.GetProcessesByName("notepad");
IntPtr hWnd = processes[0].MainWindowHandle;
if (hWnd != IntPtr.Zero)
{
WINDOWPLACEMENT placement = new WINDOWPLACEMENT();
placement.length = Marshal.SizeOf(placement);
GetWindowPlacement(hWnd, ref placement);
Trace.WriteLine(placement);
}
}
}
|
|
|
|
|
i have a class which contains several methods and all the method calls one seperate method which returns string( for e.g private string method()) now what i want to do is call the seprate method only once and use the string returned by method in all the other method so where can i call this method will calling it in constructure do.
|
|
|
|
|
all call it from the constructor, but be sure that you initializes
all the variables you need
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
yes u can call this method in class constructor and store the value in variable
and then can use that variable to pass in other methods.
rahul
|
|
|
|
|
Hi,
Kindly help me to convert following lines into c#:
Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As Long, ByVal XCord As Long, ByVal YCord As Long) As OLE_COLOR
Private Declare Function GetWindowDC Lib "USER32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "USER32" (ByVal hwnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetDesktopWindow Lib "USER32" () As Long
Thank you
|
|
|
|
|
Hi,
To convert any VB code to c# this link is very usefull:
//www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx
well C#conversion of your VB code will be following:
[System.Runtime.InteropServices.DllImport("GDI32")]
private static extern OLE_COLOR GetPixel(long hDC, long XCord, long YCord);
[System.Runtime.InteropServices.DllImport("USER32")]
private static extern long GetWindowDC(long hwnd);
[System.Runtime.InteropServices.DllImport("USER32")]
private static extern long ReleaseDC(long hwnd, long hDC);
[System.Runtime.InteropServices.DllImport("USER32")]
private static extern long GetDesktopWindow();
|
|
|
|
|
|
Is the original code VB6 or VB.NET?
If it's VB6, then the equivalent C# code will need the long's changed to int's since VB6 Long is the same size as C# int (or VB.NET Integer).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: C# to Python converter, VB to Python converter
|
|
|
|
|
Hi,
I need to know the Language name of following code:
0001100000110000111100011110011001101100111111111110000111000010000000 <<= what is the language name of said code?
Thank you
|
|
|
|
|
|
Thank you sir,
is there any method to convert from binary to string?
|
|
|
|
|
If you are sure that that binary sequence represents a piece of code, then you should read the documentation describing the assembly instructions of the processor family that the machine executing this code belongs to.
The fist x bits(x can take different values) represent the opcode of the assembly instruction. If you know the opcode, you can quicly find the name of instruction. The other bits represent addressing modes and operands.
Good luck!
|
|
|
|
|
Hi,
I need to convert a string of 16 chars "0123456789ABCDEF" to 8 bytes x'0123456789ABCDEF' in c#.
Can anyone help me with this?
Thanks
David
|
|
|
|
|
string s = "0123456789ABCDEF";
Int64 i = Int64.Parse(s, NumberStyles.HexNumber);
byte[] b = BitConverter.GetBytes(i);
Console.WriteLine("0x{0:X}", i);
|
|
|
|
|
Hello,
I have created a Window Application using C#. Now I would like to create an installation package out of it which I can pass it to friends and families to install it on their computer and give it a try.
I have learnt that I can follow publication steps "Build -->Publish" and make use of the Publish Wizard to create installation package.
My google search made me aware of the following software:
1- WiX installer
2- Nullsoft Installer
3- MSI Installer Tool
4- Inno Setup
which apparently are meant to be Windows Installer authoring tool.
Now I am very confused and would appreciate if someone can tell what is going on and what I need to use in order to create a single installation file.
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
First You've to compile your code in release version.
Now Add installer project;
In installer properties you specify to install dotnet framework with your application.
In short:
Needs for application installation are:
Windows installer 3.1
Dot Net FarameWrok 2.0
Application MSI or EXE installation file.
thats all. You've to install the written all packages one by one in the same order.
God Bless you.
Syed Shahid Hussain
|
|
|
|
|
Hello I am an newbie in C# and I am making a program for our office and need to develop a class in c# that I can use for a login form. The table I have is very simple for username and password. It has a UserID which is a primary key and a password I dont care about the username just as long as they type in the right password. I also have a bool column that is IsLoggedIn. I have to set the IsLoggedIn in the table to true once the password has been typed in right. There will only be 4 possible logins or passwords.
I have a connection to the database like this:
public static void Login(String LoginBox)
//{
// string strConn, strSQL;
// strConn = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\admin\My Documents\Visual Studio 2005\Projects\GasCabinetSimulator\GasCabinetSimulator\GasCabinet.mdf;Integrated Security=True;User Instance=True";
// strSQL = "SELECT UserID, PassWord, IsLoggedIn FROM tblLogin";
// using (SqlConnection cn = new SqlConnection(strConn))
// {
// try
// {
// cn.Open();
// }
// catch (SqlException ex)
// {
// MessageBox.Show("Connect Attempt Failed");
// MessageBox.Show(ex.Message);
// return;
// }
// using (SqlCommand cmd = new SqlCommand(strSQL, cn))
// {
// try
// {
// using (SqlDataReader rdr = cmd.ExecuteReader())
// {
// while (rdr.Read())
// if (LoginBox == rdr["PassWord"].ToString())
// {
// MessageBox.Show("Login successful","Login Success",MessageBoxButtons.OK,MessageBoxIcon.Information);
// //rdr["IsLoggedIn"] = true;
// }
// rdr.Close();
// }
// }
// catch (SqlException ex)
// {
// MessageBox.Show("Query failed");
// MessageBox.Show(ex.Message);
// return;
// }
// }
// cn.Close();
However it is readonly and I cant change the IsLoggedIn column and I get a box for each username or password until it is either the right one or the wrong one totally.
Allan F. Gagnon
|
|
|
|
|
You should do a select count(*) where the username and login equal the values that were entered
That means only the data layer ever knows the real values.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am sorry but I am not sure what you mean. Should I change my select statement to a Select Count?
Sorry
Newbie still learning!!
Allan
Allan F. Gagnon
|
|
|
|
|
Yes. You shouldn't ask the database to tell you all the passwords. You should tell the DB what username and password you were given, and have it tell you if it's a valid pair.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank You
Allan F. Gagnon
|
|
|
|
|
hello All,
The template field in gridview has a html table which is binded to datasource from sql server all the data is displayed fine my question is, is it possible to display the data in two columns instead of one column, if Yes how is it done. Please see below for code, Any suggestions are appreciated.
<itemtemplate>
" width="100" height="100" border="0"> | | $<%# Eval("Price") %> | | <%# Eval("ProductName") %> | |
Thanks in Advance for your help. Best Regards
|
|
|
|