|
I have a popup displayed with a form by function:
taskbarNotifier1.Show("HostName: \n\n SiteHit: \n\n Survey: \n\n TAF: \n\n ATO: ", strQuery, 300, 2000, 300);
Now these hostname,survey,taf,ato i have to get from database :
select url,sitehit,survey,tellafriend,addtooutlook from tblsummary where...
of current datetime ie the last current entry of database and display all these data in 'strQuery' in above function in a line ie one after other like this :
Hostname : nekshan@yahoo.com
Sitehit : 1
Survey : 0
These in bold are data to be displayed by the query.
how to get all this data in one variable to put it in my function n display data in this format.
Hope u r getting my Point.
Thanx
nekshan.
|
|
|
|
|
Create a struct to hold all this data, if you want to pass it all in one go.
Or, if it has to be a string, use a delimiter or build a query string, like a URL.
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 )
|
|
|
|
|
function can only return one value
so if u want all three then u have to concat all in one variable like
str = str1 + '#' + str2 + '#' + str3
then return str from function
now on form u have to seperate all three from str by using mid(str,'#',1) like this not exactly this function is. u have to seperate like this all in different variable then use it.
bye. virendra.
|
|
|
|
|
Yeah, that's one of the answers I gave. Why did you give it 4 times ?
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 )
|
|
|
|
|
function can only return one value
so if u want all three then u have to concat all in one variable like
str = str1 + "#" + str2 + "#" + str3
then return str from function
now on form u have to seperate all three from str by using mid(str,'#',1) like this not exactly this function is. u have to seperate like this all in different variable then use it.
bye. virendra.
|
|
|
|
|
function can only return one value
so if u want all three then u have to concat all in one variable like
str = str1 + "#" + str2 + "#" + str3
then return str from function
now on form u have to seperate all three from str by using mid(str,"#",1) like this not exactly this function is. u have to seperate like this all in different variable then use it.
bye. virendra.
|
|
|
|
|
function can only return one value
so if u want all three then u have to concat all in one variable like
str = str1 + "#" + str2 + "#" + str3
then return str from function
now on form u have to seperate all three from str by using mid(str,"#",1) like this not exactly this function is. u have to seperate like this all in different variable then use it.
bye. virendra.
|
|
|
|
|
Hi i am diplaying a windows control in my web page (aspx page), so i am embedding the object in the html code as shown below,
<object id="AMATGraph1" height="100%" width="100%" align="middle" border="0" classid="http:/RSWEB/SmartClients/AMATGraph_" +="" amat.web.defines.getsmartclientversiondirstring()="" "="" amatgraphing.dll#amatgraphing.controls.amatgraphcontrol"="" viewastext="">");
<param name="Server" value="" + _server + "" />
<param name="Username" value="" +="" _username="" ""="" />
<param name="Password" value="" +="" _password="" ""="" />
<param name="HeaderVisible" value="false" />
<param name="FooterVisible" value="false" />
<param name="ControllerClass" value="" +="" _controller="" ""="" />
<param name="AccountName" value="" +="" _accountname="" ""="" />
Now, i want to capture onclcik event raised in windows application in my aspx page, how should i achieve this please advice
Thanks in Advance
|
|
|
|
|
I'm writing a client\server application, and I have a problem in server part because I want that part to manage more than one client at time, I used asynchronous operations and here comes the problem, I don't know how these function exactly works( I mean in the runtime environment) , this is the code summarized as possible, in the form constructer
server = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("169.254.25.129"), 9050);
server.Bind(ipep);
server.Listen(-1);
server.BeginAccept(new AsyncCallback(AcceptConn), server);
The asynchronous callback function (AcceptConn) accepts one incoming connection and assign a socket to deal with this connection, and at the end of the function I call the BeginAccept function again to begin to accept other incoming connections.
I have a class ConnectionInformation to keep all the information a bout one connection, and the ConnSock is a property to access the socket member in the class
And the sockCount to keep track of instances of ConnectionInformation in the array connInfo.
public void AcceptConn(IAsyncResult iar)
{
Socket oldServer = (Socket)iar.AsyncState;
connInfo[sockCount].ConnSock = oldServer.EndAccept(iar);
connInfo[sockCount].ConnSock.BeginReceive(DataReceiveBuffer, 0, DataReceiveBuffer.Length,
SocketFlags.None, new AsyncCallback(ReceiveData), connInfo[sockCount].ConnSock);
FillInDataGridView(connInfo[sockCount]);
server.BeginAccept(new AsyncCallback(AcceptConn), server);
}
And in the asynchronous callback function(ReceoveData) for the BeginReceive operation I do the same
public void ReceiveData(IAsyncResult iar)
{
Socket remote = (Socket)iar.AsyncState;
int recv = remote.EndReceive(iar);
remote.BeginReceive(DataReceiveBuffer, 0, DataReceiveBuffer.Length, SocketFlags.None,
new AsyncCallback(ReceiveData), remote);
}
The problem is when I run the application, and after I run two client application, the server part stucks on the screen and refuse to do any thing,(note: I'm using datagridview to show connection information).
i didn't know what the problem since the compiler didn't show any error, is that because there is finite loops in the AcceptConn and ReceiveData functions, or do these operations took a lot of memory.
and what its better, using asycnh operations, or begining a thread and using blocking method indide these thread.
I need advise on hints, if there is other way easier than the code above I would appreciate to know about, or any other suggestion.
And thanks in advance.
|
|
|
|
|
How to protect code from reverse Engineering and get source code? As decompiler are easily available any one can easly get source code.Can Strong Name or obfuscator software guarantee source code protection.Is there any other technique apart from these?any other language like vc++ or java code have more security features ?
|
|
|
|
|
All .NET assemplies can be decompiled, you may use obfuscator, and there is other programs to protect the dll as all, seacrh google for it.
|
|
|
|
|
You can never get the original source code from the executable file, but it's always possible to reverse engineer it.
You can use obfuscators to make the process harder, but there is no sure protection.
---
single minded; short sighted; long gone;
|
|
|
|
|
C# is essentially Java. C++ is more secure, by a long shot, but any language can be decompiled.
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 )
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
{
conn.Open();
System.Windows.Forms.Form login_ = new login();
login_.Show();
if (login_.Close())
{
Application.Exit();
}
conn.Close();
}
i m opening this form 'Login' on button click n then if i close this form by clicking on close button, application itself must also stop running automatically. As even if i close all forms the application keeps on running till i stop it myself.
Plz help on it.
Thank You.
-- modified at 1:13 Monday 19th February, 2007
|
|
|
|
|
You have to set up an event handler for the Form.Closed or Form.Closing events then handle your application exiting functionality there. However you're going to want to probably inherit the form class into a new loginform class so that you know the internal state of the login form so you will know if the form window is closing because the [X] was pressed, or because the login process completed and it's time to move onto different things, without exiting the application.
|
|
|
|
|
first remove this
If (login_.Close()) Then
{
Application.Exit();
}
one prob solve.
|
|
|
|
|
but after i logout, this login form is shown again, now if i close this login form from close button, application must also end automatically,which is not ending till i stop it myself.
how to do it?
AND
i want to access 'url' of current datetime.
"select url from tblsummary where accessdate = " + DateTime.Now;
this is giving error.
thanx.
nekshan.
|
|
|
|
|
"select url from tblsummary where accessdate = '" + DateTime.Now + "'"
now work.
|
|
|
|
|
lunch time. bye..after 1 hr.
|
|
|
|
|
if u want to close application on close button
then write this code on close button click
Application.Exit();
|
|
|
|
|
write above reply mail on close button of login page.
and replay me
|
|
|
|
|
gng for lunch.
tell u later.
nekshan
|
|
|
|
|
Arey, 'close' is not my button, it is the form close button on top right side with minimize n restore buttons.
|
|
|
|
|
Private Sub formName_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Application.Exit();
End Sub
this is the even of form this is called at the time of form closing. ok
and formName is the name of form.
|
|
|
|
|
thanx, yes it is working.
take care. cu
|
|
|
|