|
Message Closed
modified 23-Nov-14 6:37am.
|
|
|
|
|
Well, I have built my deployment project from that Web page ( )
It doesn't work!
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:37am.
|
|
|
|
|
My solution in Visual Studio consists of several projects.
1. One DLL project which holds the business code
2. One project that is the service - reference is made to previous project
3. One Console project used to force a execution without the service - reference is made to first project (DLL project)
4. Setup deployment project - reference is made to the service
|
|
|
|
|
In C# web application Requirement is when using admin panel admin inserts categoy,product etc then update also his store database on Ebay i hv integrated site with Ebay store db and updating that too. But Saving data takes time and Admin gets logout automatically I think default session time is up Plz help how to handle this
|
|
|
|
|
Not necessary that Session has timed out. It could be databse transaction timeout too. Or the established Connection timeout. You need to debug and find where the bottle neck is and increase the time accordingly.
|
|
|
|
|
I want to read and edit one of the values in Registry with REG_BINARY Format. How to read it. can any one help me out regarding this Please... It s Urgent......... 
|
|
|
|
|
If it would be that urgent, I would put this question to google.
(I used 3 words of your question with google and the first 3 entries hit!)Greetings
Covean
|
|
|
|
|
Reading and writing values in the registry is the same regardless of the format. In the case of REG_BINARY the returned object is of type byte[] . The following code would convert that to a string. You would reverse the process to write it back.
RegistryKey regKey3 = Registry.CurrentUser;
RegistryKey regSub3 = regKey3.OpenSubKey("Software or whatever");
byte[] ans = (byte[])regSub3.GetValue("Value I need");
string sString = System.Text.Encoding.ASCII.GetString(ans);
string [] sArray = sString.Split('\0');
sString = "";
foreach (string s in sArray)
{
sString += s;
}
Now sString should have your string from the reg_binary ready for processing.
|
|
|
|
|
HI, i am using Random class in my code like below
private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max);
}
and i am clalling this method in for loop. my expectation is for every iteration in the loop i am expecting some new random number. code for that is like below:
string waybill= "W" + RandomNumber(10000, 90000).ToString();
Problem: everytime i am gettting same random number fr every iteration. instead of generating different random number.
can any one help me , where i done the mistake.fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
The problem is, that new Random(); uses the current time to set the starting seed.
If you call this in a too short time period twice it returns the same random number.
Use something like this:
public class ...
{
private int RandomNumber(int min, int max)
{
return m_rndGen.Next(min, max);
}
private Random m_rndGen = new Randow();
} Greetings
Covean
|
|
|
|
|
Don't instantiate a new Random every time. Treat random as a singleton.
Random will (by design) give you the same sequence of numbers every time unless you start with a different seed. Right now you are getting the first number of the sequence every time.Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Make the Randon instance a (static) member of the class.
|
|
|
|
|
The default constructor for the Random class uses the system clock to seed the random number generator. Your code is running fast enough that the system clock has not changed between calls to the constructor, resulting in the same random numbers being generated each iteration. See the MSDN documentation for the Random constructor[^] for more clarification and a good example.
|
|
|
|
|
I am newly started working on C# for web application. Not able to get Browse option in my application, to browse images and documents and upload it. guru
|
|
|
|
|
And what errors and/or difficulties are you facing?
Please provide the failing code..
|
|
|
|
|
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlInputFile File1;
protected System.Web.UI.WebControls.Button cmdUpload;
protected System.Web.UI.WebControls.Label lblMessage;
string sFileDir= "C:\";
long lMaxFileSize = 4096;
ERROR:-Error 28 Unrecognized escape sequence C:\Documents and Settings\guru\Desktop\Product implementation\Uplode.aspx.cs 24 36 C:\...\Product implementation\
At above bold line was casing problem. I am not able to understood this exception.guru
|
|
|
|
|
Use either "C:\\" or @"C:\" instead of "C:\" - the '\' character is an escape, so the compiler thinks you want to include a double quote character in your string rather than terminating it. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
this small tip solved 90% my problem.
thnxguru
|
|
|
|
|
i want to make a software that should run as service
and as when as user send any type of print my software dialogs should be work
so please help me how i can capture print command for my software
Regards
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:38am.
|
|
|
|
|
this is defining to check printers and then commands
i want to trace print commmand
as when as user want to send print my work should start
|
|
|
|
|
You need to write a printer driver and set your 'device' as the default printer. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
it is very easy to detect if someone work with mouse move event of picturebox. but i want to detect mouse over picturebox in mouse move event of the form so first i did set the keypreview property of form to true and then i wrote the code in mouse move event of form.
so my code is ---
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
int X=e.X;
int Y=e.Y;
if ((X >= pic.Left && X <= pic.Left + pic.Width) && (Y >= pic.Top && Y <= pic.Top + pic.Height))
{
lblMsg.Text = "Mouse over picturebox";
}
else
{
lblMsg.Text = "";
}
}
this code is not working. where i am making the mistake. please rectify me.
i tried this with another approach like
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (pic.Bounds.Contains(PointToClient(new Point(e.X, e.Y))))
lblMsg.Text = "Mouse over picturebox";
else
lblMsg.Text = "";
}
please help me with sample code.
thanks in advancetbhattacharjee
|
|
|
|
|
Form.KeyPreview is all about keyboard input, not mouse actions. The latter always go to the active Control, not the Form containing it.
|
|
|
|