|
asim araeen wrote: please help me and tell me the "Algo of sniffing detectoin"
That is what your graduate adviser is for. Ask him or her for help.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hai all,
if your program store a user password, where you normally tore them?
i.e. registry, ini, text files etc.
|
|
|
|
|
if your program have multiple user then i prefer to store it in database( like MSAccess, SQL Server etc.) or if your program have only single user then you can store in any way like in text file, XML file, registry , database or even in code(bad option). you can also store user name and password in registry in encrypted form
|
|
|
|
|
Hai swami,
Thanks a lot. so i preferre to store it in the registry under my programs key. i have only two other values for my programs. so with the password, then only 3 values. so is it ok to store the password in a value call "user_password" and the data is the 31bit encrypted password.
will this value name "user_password" ok or still i need to put a junk name for the value?
|
|
|
|
|
afridy wrote: o i preferre to store it in the registry under my programs key
choose some different name for key so it seems like the key of Windows OS key
afridy wrote: will this value name "user_password" ok or still i need to put a junk name for the value?
same for here as above
|
|
|
|
|
I'm not sure this is the correct place to post but since I wrote the code in vb I figured I would start here. I have a service that I created that writes to a text file, but it only writes 16 times and then stops. I have not asked it to stop it just does it on it's own. I am using this for testing because I have a bigger project that I need to create as a Window service and the timer wasn't working in it. So I created this small testing project and still can't get the timer to work correctly. Could some one please give me some clues as to what might be wrong with the code? I copied below what I am using.
Public Class AuthorLog
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
Const iTIME_INTERVAL As Integer = 15000 ' 15 seconds.
Dim oTimer As System.Threading.Timer
Dim strline = vbCrLf
System.IO.File.AppendAllText("C:\AuthorLog.txt", "AuthorLogService has been started at " & Now.ToString() & vbCrLf)
Dim tDelegate As Threading.TimerCallback = AddressOf EventAction
oTimer = New System.Threading.Timer(tDelegate, Me, 0, iTIME_INTERVAL)
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
End Sub
Public Sub EventAction(ByVal sender As Object)
System.IO.File.AppendAllText("C:\AuthorLog.txt", "AuthorLogService fires EventAction at " & Now.ToString() & vbCrLf)
End Sub
End Class
Thanks for your assistance in advance.
Carolyn
If you can’t have fun at work, then why go to work?
|
|
|
|
|
It probably stops when the oTimer object get's garbage collected, since it's no longer in scope when your OnStart method gets to End Sub . Using a Timer to run a service is pretty much bad practice. You normally use the OnStart method to setup and start a new Thread containing your service code.
|
|
|
|
|
I am really not understanding the reply. I thought timers were used in services to set how often it should run. Could you explain how a service would be set up? Everything I have researched and looked up on services shows the setup like I have in the code snippet above.
Thank you.
If you can’t have fun at work, then why go to work?
|
|
|
|
|
CARisk3 wrote: I thought timers were used in services to set how often it should run
Wrong. Timers are used in any application to execute code at a specific interval. They are not specific to services, and frankly, when I see a timer in a service, I immediately suspect it's not being used properly, or for the right reasons.
CARisk3 wrote: I am really not understanding the reply.
What's hard to understand? You simply stop the timer at the start of your timer tick handler and restart it at the end. That way, the timer won't call your code again until you're ready for it to do so.
CARisk3 wrote: Everything I have researched and looked up on services shows the setup like I have in the code snippet above.
That's the problem with using other peoples code. You don't know why they're doing something, or if it's even the correct way to do want you want.
|
|
|
|
|
Could you help me understand? I need to have a program run every half hour to check the server to see if new folders have been created. If new folders have been added then I need to update the database with the new folder names. (The reason I am doing this is we have a content management system and if the users add new folders to the server then the cms doesn't recognize them. The users are putting content into the folders and then linking to files within the new folders from cms.) To my understanding this should be a service.
I created the routine in Visual Studio 2005 and when I run it manually, it does what I need it to do. It adds the folders and permissions correctly. The problem is I don't want to have to remember to run the application every half hour. Plus our users could be adding content at any time of the day or night.
I really need to understand how services work and how to set them up correctly as my supervisor is wanting me to automate some other routines. If you don't have time to explain, could you point me in the direction of a book or website with a good explanation and examples. I've been trying to get this to work for a couple of months.
If you can’t have fun at work, then why go to work?
|
|
|
|
|
Normally, you'd use the OnStart event of the server to start a new thread. This thread, in your case, would setup a FileSystemWatcher and sit there, waiting for events. The FileSystemWatcher fires a Created event whenever a file or folder is created in the directory it's watching. This is where you'd do you database update.
You wouldn't use a Timer to do this at all.
Try looking at this[^] and this[^].
|
|
|
|
|
Thank you very much. I didn't know about the file watch feature. I will read through the two links and see if I can apply them.
Do you know of any good books or websites that explain how to set up services that aren't file watchers? We are also wanting to set up some services that will synchronize data between a bought system and our in house systems.
Once again thank you very much for taking the time to respond to my questions and pointing me in the right direction.
If you can’t have fun at work, then why go to work?
|
|
|
|
|
I used VS 2008 to develop and deploy a small VB web project. The sample app has two buttons. One button will create a xml file and the other button will create a text file, see code below. Unfortunately, when I press either button on the web page, I get an “HTTP Error 404 - File or directory not found.”.
Any ideas on what the problem might be. The project works as advertised locally. By the way, how does VS (using a WEB project) handle calls to local drives? Let’s say that I am placing a file in the folder located at “C:\customers”. Does that translate to web, meaning the www.root folder?
Dim xmlFileName As String = "SampleWebApplication.xml" 'ensure each session is unique<br />
<br />
Using writer As XmlWriter = XmlWriter.Create(xmlFileName, settings)<br />
writer.WriteStartDocument()<br />
<br />
writer.WriteStartElement("Application")<br />
<br />
writer.WriteStartElement("Accept_Date")<br />
writer.WriteValue(Date.Now())<br />
writer.WriteEndElement()<br />
<br />
writer.WriteEndDocument()<br />
<br />
writer.Flush()
Using sw As StreamWriter = New StreamWriter("TestFile.txt")<br />
sw.WriteLine("This is a test")<br />
sw.WriteLine(DateTime.Now)<br />
sw.Close()
cab3
|
|
|
|
|
Ask this question in the ASP.NET forum.
I will tell you that one of the problems you're having is you're not specifying a full path to the files you're trying to write. Your code assumes the current directory is the directory your web pages are being served from. You can't do that. It's always good practice to build fully qualified path names to files. In order to do that in an ASP.NET app, I think you have to look into the Server.MapPath method.
|
|
|
|
|
Thanks very much. Yes you are right, and that fixed the problem.
cab3
|
|
|
|
|
i have faced problem in crystal report.
|
|
|
|
|
And?? You might want to describe the problem, including any error messages you're getting.
|
|
|
|
|
So have I, many a time
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Well, has the thought occurred to you to be a little more specific about your problem?
prakash_adysoft wrote: i have faced problem in crystal report.
How do you expect anyone to help with a post like that?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Can anybody tell me how to get the company name which was given at the installation time of O.S.
If you know then tell me in VB.net
Gagan
|
|
|
|
|
I think it's just in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion key, under RegisteredOrganization .
|
|
|
|
|
Thanks for ur help The JZ..
It works..
|
|
|
|
|
I have used much graphics in my project and in result, my program is working very slow.
Graphics are used to draw the title of product and it also creates craphics to work as a background image.
Some graphics are also used to give a pure "Glass" look to program and components used in it(ex-buttons,forms etc.).
Plz help to seed up the execution of program with the same graphics.
Gagan
|
|
|
|
|
There's no one command or thing you can do to speed up the code you've written. You simply have to go through the code and think of different ways of doing what you are. For example, If you're contantly redrawing the same static graphic, draw the image once to a bitmap, then just draw that bitmap image to whatever you need.
|
|
|
|
|
Thanks for ur suggestion Dave Kreskowiak
|
|
|
|