|
hi
i am testing whther a device is connected or not to the usb.i want the status to be displayed dynamically in a label.if i use Thread.sleep() only the final status is getting displayed.intermediate statusus r not visible.
could u plz help me out.
thank u
sincerly
cynthia
|
|
|
|
|
Try to put your method in a separate Thread.
|
|
|
|
|
You could check the connection status in a timer tick (quick and dirty) or a separate thread (recommended).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I think UI thread doesn't get time to redraw.
On every updation of status put the following code
<br />
yourLabel.Text="status";<br />
mainForm.Refresh();
this refresh method will repaint the GUI
|
|
|
|
|
hi all,in my web application i use form authentication mode it works fine in my local system, but in server it wont work and wont allow me to log in (when i click on the link it load the login page again)what willbe the problem .here is my webconfig file ....
authentication mode="Forms">
<forms name=".auth" loginurl="login.aspx" path="/">
/authentication>
authorization>
deny users="?" />
/authorization>
help me to solve this prob........
Regards,
ayyp
-- modified at 7:34 Friday 14th July, 2006
|
|
|
|
|
I also had the same problem , i use forms authentication to access some pages , it is working fine in my local system, but it is returning to the login page again and again when it is hosted in a hosting server.
VB.net code
----------------
FormsAuthentication.Initialize()
FormsAuthentication.HashPasswordForStoringInConfigFile(TxtPwd.Text, "sha1")
Dim ticket As New FormsAuthenticationTicket(1, TxtLoginID.Text, DateTime.Now, DateTime.Now.AddMinutes(180), False, userrole)
Dim hash As String = FormsAuthentication.Encrypt(ticket)
Dim cookie As New HttpCookie(FormsAuthentication.FormsCookieName, hash)
Response.Cookies.Add(cookie)
FormsAuthentication.RedirectFromLoginPage(TxtLoginID.Text, True)
Global.asax code
-------------------
Imports System.Web.SessionState
Imports System.Web.Security
Imports System.Security.Principal
Namespace FormsAuthDB
''' <summary>
''' Summary description for Global.
''' </summary>
Public Class [Global]
Inherits System.Web.HttpApplication
Public Sub New()
InitializeComponent()
End Sub
Protected Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
If HttpContext.Current.User IsNot Nothing Then
If HttpContext.Current.User.Identity.IsAuthenticated Then
If TypeOf HttpContext.Current.User.Identity Is FormsIdentity Then
' Get Forms Identity From Current User
Dim id As FormsIdentity = DirectCast(HttpContext.Current.User.Identity, FormsIdentity)
' Get Forms Ticket From Identity object
Dim ticket As FormsAuthenticationTicket = id.Ticket
' Retrieve stored user-data (our roles from db)
Dim userData As String = ticket.UserData
Dim roles As String() = userData.Split(","c)
' Create a new Generic Principal Instance and assign to Current User
HttpContext.Current.User = New GenericPrincipal(id, roles)
End If
End If
End If
End Sub
Protected Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
End Sub
#Region "Web Form Designer generated code"
''' <summary>
''' Required method for Designer support - do not modify
''' the contents of this method with the code editor.
''' </summary>
Private Sub InitializeComponent()
End Sub
#End Region
End Class
End Namespace
Code in web.config inside the login pages folder
--------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authorization>
<allow roles="admin" />
<allow roles="OtherAdmin" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
Please help me this is very important for me.
Thanks in advance....
|
|
|
|
|
hai all,
is there any particular function by which i can directly use unicode in API..
for eg:
TextOutA(hDevice, sXPos, sYPos, StaticObjects.gtSizeName[lIndex], StaticObjects.gtSizeName[lIndex].Length);
here can i use language "HINDI" for [lIndex]...i tried but it is giving "???" in the places where "HINDI" language is used while running.
|
|
|
|
|
Use TextOutW
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
can u plzz sent the syntax the how to use TextOutW
Regards
|
|
|
|
|
Hi,
Here's the code (and it works):
< --snip-- >
string deleteStateName = "Bullamakanka";
// find the StateID for the record to be deleted
foreach(DataRow dataRow in newStateDataSet111.Tables["States"].Rows)
{
string StateName = (string) (dataRow["StateName"]);
int StateID = (int) (dataRow["StateID"]);
if (StateName == deleteStateName)
{
deleteStateID = StateID;
}
}
< --snip-- >
There is either a simpler way of achieving this without looping thru each record or I have structured the whole programme incorrectly.
I've read, read and re-read all I can find on the net in regards to datasets and understand how to create them and save changes to them BUT I cannot figure out how you can easily locate values of fields within them to enable me to easily manipulate the row concerned. I'm very frustrated bcause I know the answer to the meaning of life and feel I'm on the brink of yet another major revelation!
Pointers will be appreciated to any articles written in laymans terms so I can understand it all please.
TIA.
Glen Harvy
|
|
|
|
|
Hi,
DataRow[] foundRows = dt.Select("StateName = '" + deleteStateName + "'");
|
|
|
|
|
Robert Rohde wrote: DataRow[] foundRows = dt.Select("StateName = '" + deleteStateName + "'");
Thanks for that - I just knew there would be.
Now - how did you know to use
Robert Rohde wrote: '" + deleteStateName + "'
because it's not obvious to me how all the ' and " and + actually converts the variable into what is/was required for the expression .
Your help is much appreciated.
Glen Harvy
|
|
|
|
|
Hi,
have a look here[^]. It covers most things you can do with Select . It can also be used as a reference for the DataColumn.Expression and DataView.RowFilter properties which take similar expressions.
|
|
|
|
|
Hi,
I actually found this link sometime late Saturday after my original post. After much reading (and testing) I found I couldn't pass a variable to the expression - I kept getting a "column doesn't exist", cast error or similar. Hard coding worked.
What you showed me was how to use the single quote, double quote and the plus sign to get the variable into the expression. Not just there either - I didn't know how to use a variable in a messagebox text area until you showed me.
I have a couple of books on C# / VS2003 and neither go into any depth at all on this and I was wondering if there is any other source on the net where these obviously essential snippets can be found.
One real problem I'm having is using the right phraseology to locate the relevant help on the net!
Again - thanks for you help,
Regards,
Glen Harvy
|
|
|
|
|
hi all, in my web application home page, i use link buttons (to redirect to other pages from the home page)it work well in my local system but when i put my application in the sever, the links are not working(ie:the result page is not displayed when click on the link)but it shows the respective url on the address bar(like www.xxxxxxxx.com/home.aspx?ReturnUrl=%2flogin.aspx and this same url is displayed,when i run it in my local system)what will be the problem....
Regards,
ayyp
|
|
|
|
|
Hi,
I have a Dialog based Application and I want to achieve the following thing:
I have a certain area described by a Panel and want to insert there several subforms according to a selected function. I tried to generate a Page as WinForm and set the Parent to the Panel Control, but this didn't worked out. How can I generate several subforms and display them in a clientarea in my main application form.
In usual Win32/ATL this was done with OLE_PropertyPages. Is there any equivalent I'm missing at the moment ?
Bye,
Florian
|
|
|
|
|
Maybe you are looking for "User Control" which are in the "Add Item" window.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hi.
Is that possible to change the back color of a tab control or tab control's buttons?
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
In .NET 1.1 you cannot change the tab color. But see this:
http://www.codeproject.com/cs/miscctrl/flattabcontrol.asp
|
|
|
|
|
I'm using .Net 2.0.
Many thanks for the article.
Regards
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Is there a way to keep the trackbar that .net provides and somehow keep the tickstyle in both since i love the way the tracker looks that way but still remove the ticks? I mean that i would like a TicksVisible property like! I think that something like this exists in delphi if i am not mistaken.
|
|
|
|
|
Hi,
you can set the TickStyle property to None.
|
|
|
|
|
Hey all,
After installing the latest version of the Symbol SDK it seems to have setup a requirement to install the framework on each deploy so debugging is becoming a pain especially when I have to cancel the installation on the handheld each debug.
If you hadn't already guessed, i'm using VS 2003 and I cannot find anywhere that states where these files are, although I know "where" they are, and I have deleted them. But now I receive an error on each deploy stating it cannot find these files.
Sooooo, does anyone know where the hell these files are referenced?
TIA
Gav
|
|
|
|
|
hi all,
there is 2 table (maintable[numdoc_id,...]) and(subtable[id,numdoc_id,...])and there is a one to many relation between 2 table .
in the MainForm :
...<br />
private int get_num_ID;<br />
...<br />
private int NUM_MY_ID(out int MY_ID)<br />
{<br />
...<br />
strFindID = "SELECT MAX(numdoc_id) as numdoc_id FROM MainTable";<br />
...<br />
MY_ID = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());<br />
MY_ID++;<br />
return MY_ID;<br />
}
and for Insert Function in MainForm for subtable :
private void ADD_INTO_SubTable()<br />
{<br />
...<br />
try{<br />
strSQL_P = "insert into subtable(numdoc_id,...)";<br />
strSQL_P +="value('"+txtnumdoc_id.Text+"',...)";<br />
...<br />
}...<br />
}
and for Update Function in MainForm for subtable :
private void Update_INTO_SubTable()<br />
{<br />
...<br />
NUM_MY_ID(out get_num_ID);<br />
try{<br />
strSQL_P = "update payment set numdoc_id='"+get_num_ID+"'";<br />
strSQL_P += ... where numdoc_id=" + get_num_ID;<br />
...<br />
}...<br />
}
txtnumdoc_id control is in MainForm(for maintable), but sometimes when I click the save button in main form ,the first numdoc_id row in maintable(e.g. '1') is added to the last row for subtable in numdoc_id field . I don't know where is my wrong .
Regards ,
s_mostafa_h
|
|
|
|
|
I don't even know what is wrong. What are you trying to do?
---
b { font-weight: normal; }
|
|
|
|