|
Well it dawned on me that I already have a configuration file in the web application that I can adsorb for the database connector string and website name. So I can put the service in the web application. Took me awhile to figure that out.
Perhaps the web application can start the web service, and the service will wait for the date and time to start doing its thing via timer.
So on to my first Windows Service. It's new to me and very frustrating. I just got the base code to work, the framework, so now it
Self Installs
Self Uninstalls
Creates an Event Log
Writes to the Event Log
Connects to the service controller
net start
net stop
net pause
Writes the event log registry entry, and message id file to connect to.
WOW, that was a mind bender. There's help out there, but it's so generic.
Now I know why many said write a console app.
Well now I can go on to writing the job code, and then figure out how to write an id system dll for the event log id's and messages, and register that file.
So I'm going to try reading my config file in the web app first, and see if I can read it, if so I'm on my way to more frustration.
|
|
|
|
|
I am trying to select menu Items if based on url. below is my code and its not working, Please help
Dim strFilePath As String = Me.Context.Request.FilePath
If (strFilePath.Contains(strFilePath.IndexOf("/Groups.aspx").ToString)) = True Then
Menu2.Items(0).Selected = True
ElseIf (strFilePath.Contains(strFilePath.IndexOf("/Reports.aspx").ToString)) = True Then
Menu2.Items(2).Selected = True
Menu2.Items(0).Selected = False
Else : Menu2.Items(0).Selected = False
End If
|
|
|
|
|
IndexOf[^] returns a number. You are checking whether the string contains that number. I think you want to check whether the string contains the substring.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Here is my adjustments but it still not working
Dim strFilePath As String = Me.Context.Request.FilePath
If (strFilePath.Contains("/Groups.aspx")) = True Then
Menu2.Items(0).Enabled = True
ElseIf (strFilePath.Contains("/Reports.aspx")) = True Then
Menu2.Items(2).Enabled = True
Menu2.Items(0).Enabled = False
Else
Menu2.Items(0).Enabled = False
End If
|
|
|
|
|
What does "not working" mean?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
menu items not getting enabled
|
|
|
|
|
So what happens when you step through the code?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
it will go to the correct if to enable the items however Item is not enabled on UI
|
|
|
|
|
Add in some code to set the backgroundcolor of the control you're manipulating; that way you can check easily whether or not you're talking to the correct control, and whether all other code works.
If it does, then there's a chance that the "enabled" property is being reset or overwritten by another part of the code.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
One thing to be aware of. You're doing a case sensitive comparison of a string there. What happens if the case doesn't match what you're testing for (hint, you won't trigger any of your enable conditions)?
|
|
|
|
|
put it in the PreRender funtion
protected void Page_PreRender(object sender, EventArgs e)
{
Menu mymenu = (Menu)Form.FindControl("Menu1");
MenuItem mi = mymenu.FindItem("Programs");
mi.Selected = true;
}
|
|
|
|
|
how can I convert string ('1213,1415') to XML like this:
<planyears>
<planyear>1213</planyear>
<planyear>1415</planyear>
</planyears>
|
|
|
|
|
|
It is as simple as reading alphabets,
static void Main(string[] args)
{
string strInput = "('1213,1415')";
strInput = strInput.Trim(new char[] { '(', '\', ')' });
IList<string> strings = strInput.Split(',');
//Generate the XML
XElement planyears = new XElement("planyears");
foreach (string str in strings)
{
planyears.Add(new XElement("planyear", str));
}
}
|
|
|
|
|
Please help me i want a code which allows the user to add, edit and delete records on the datagrid in visual basic without the help of a wizard but code please help me
|
|
|
|
|
|
|
Hi,
i have a problem for making rfid program with socket in c#.
i try this code :
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
IPAddress[] ip = Dns.GetHostAddresses(ipLoc);
IPEndPoint ep = new IPEndPoint(ip[0],23);
socket.Connect(ep);
Console.WriteLine("Connected");
char open1 = (char)13;
char open2 = (char)10;
//char[] myArray = new char[] { open1, open2 };
Byte[] sendBytes2 = Encoding.ASCII.GetBytes(Convert.ToString(open1));
Byte[] sendBytes = Encoding.ASCII.GetBytes(Convert.ToString(open2));
//Byte[] sendBytes2 = Encoding.ASCII.GetBytes("10");
//socket.Send(sendBytes);
socket.Send(sendBytes2);
socket.Send(sendBytes);
count = socket.Receive(buffer);
Console.WriteLine(System.Text.Encoding.ASCII.GetString(buffer, 0, count));
//socket.Shutdown(SocketShutdown.Both);
socket.Disconnect(true);
socket.Close();
but i not have a result.. rfid card not read in console and gate cannot to open..
i hope all of you can help my problem..
thanks very much..
|
|
|
|
|
Nowhere near enough information.
I presume the socket code is trying to talk to the RFID receiver? Not the gate? It appears you are sending it a CRLF - what's the purpose of doing this?
Regards,
Rob Philpott.
|
|
|
|
|
It is probably necessary for you to have the specification for the RFID reader.
Usually there is code samples available if you go to the vendors site.
|
|
|
|
|
I have done with .Net (C# and ASP).I want to know the future scope for the .Net technology in next 15-20 years.
Thank You.
|
|
|
|
|
Me too...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
You're never going to get an answer to this question as no one on this earth has a crystal ball that really works.
|
|
|
|
|
First, What do you mean by "I have done", does it mean you having nothing else to learn in .Net?
Now, to your question,
Go back 10 years (may be to the year 2001)and recall how the .Net and C# was doing. Visualize the changes since that.
however, in next 15 years or so, the changes is going to be further sharp. No one can predict this.
Best ways are to,
1. Not only learn a language or technology, Learn the technique "How to learn and adopt"
2. Learn to travel with the time
|
|
|
|
|
We are now in the planning stage of the next web based project using C#, MVC 5 and Entity framework 6. We are discussing about framing the project using the Repository pattern. We already have the full database ready. So, it is going to be Database first.
Now, my question : Is it feasible / worth using Repository pattern with database first approach? I got this doubt because, many sources and examples found in internet are Code first approach. If it is possible can you please provide me any advice or online/article sources to refer. Thanks.
I welcome any ideas or suggestions on Repository pattern.
|
|
|
|