|
this.Mentor(this.comboLineType.SelectedIndex, Convert.ToDouble(this.utilSlackParamBar.Value) / 100.0 * this.network.GetLineType(this.comboLineType.SelectedIndex).Linespeed, 1.0, 0.4, 0.2, Convert.ToDouble(this.alphaParamBar.Value) / 100.0, "F", 1.0 - Convert.ToDouble(this.utilSlackParamBar.Value) / 100.0);
Writing composite expressions such as this in a single line of code is just asking for trouble. You have no way of checking any of the interim values that are being selected or calculated.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
What extra information is that supposed to convey?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
You should have posted that earlier. Why it's obvious now. I can obviously tell what your code looks like from the different shades of grey there (I counted 50 of them).
And, yes, that was sarcasm.
|
|
|
|
|
The program is available on the internet. Just search for 'wlvnet' on Google, please.
|
|
|
|
|
If you expect people to help you then try responding to some of the questions that have been posted. If you think people are going to download some vaguely identified piece of code from the internet, build it and debug it on your behalf, then I'm afraid you are going to be disappointed.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
What is Interface? In Which Scenarios Use It?
Raghu RR
|
|
|
|
|
Both of these questions could be answered by a quick Google search[^], or reading the documentation.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I suggest you look up what it is, and try to formulate an answer to your homework. I can give you the answers without thinking, but that would be just as useful as counting the grains of sand in a desert - it'd be a waste of time.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Abstract Class ? In which Scenarios use it over Interface?
Raghu RR
|
|
|
|
|
An interface defines the signatures for a set of members that implementers must provide. Interfaces cannot provide implementation details for the members. For example, the ICollection interface defines members related to working with collections. Every class that implements the interface must supply the implementation details for these members. Classes can implement multiple interfaces.
Classes define both member signatures and implementation details for each member. Abstract classes can behave like interfaces or regular classes in that they can define members, and they can provide implementation details but are not required to do so. If an abstract class does not provide implementation details, concrete classes that inherit from the abstract class are required to provide the implementation.
So here you can see the difference. Based on the understanding about your requirements in the project. You should implement either Interface of abstract class.
|
|
|
|
|
Hello - My company has a large TFS structure and my team has a requirement to replace references to one site domain with references to another site domain.
I was trying to see if there was a way to do this search through TFS itself. In VS, Edit > Find and Replace > Find in Files only searches the sln open in VS which does not satisfy my requirement. File > Source Control > Find in Source Control > Wildcard opens a Search window with Recursive checked by default. However, this search only appears to search file and folder names but not file contents. For example, a search for "string" at the TFS root level should return hundreds of references but only returns a reference to a folder named "string".
So is there a way to do a full recursive search for text within the files from the root level of TFS? The ways I described above don't seem to accomplish my goal unless I'm missing something. I'm guessing someone here has had a requirement to something similar to this before....
|
|
|
|
|
i m trying to make a local search engine.
i use a master page on which my search bar is located and now i want to show the result on the another page result.aspx........plz help me......and tell me which control is best for showing results on page like local serch engine....here i m using repeater control but it is not so promising ...no paging nd all....... thanks in advance to all
|
|
|
|
|
mahesh s charan wrote: and tell me which control is best for showing results on page like local serch engine....here i m using repeater control but it is not so promising ...no paging nd all.......
.......
Ideally, there'd be a single control that does all, with us only assigning our favorite color to it. That's not how programming works however. Applications are built using multiple controls, and there are quite some examples out there on "adding paging".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
|
I have a Windows forms app which uses WCF services. Our application sends messages using one of our WCF services to specific users running our client, so our callback “http:” string is dynamically constructed each time a message is sent to a user. It includes the server IP address and port (126.221.97.105:701) onto which the current user is logged, the user’s id (56281), and the client GUID (7392d27a-e4a0-42e2-89a3-adc332e28934). So, a typical callback “http:” string looks like this:
http://126.221.97.105:701/CmesCns/CALLBACK/56281/7392d27a-e4a0-42e2-89a3-adc332e28934
We have an http namespace (http://+:701/) on our client and the group “Everyone” is tied to this namespace with all of the access permissions checked (GenericAll, GenericExecute, GenericRead, and GenericWrite). We use “http namespace” to create our namespaces.
Our application has been in production (on Windows Server 2003) for a few years and everything is working fine.
We have recently converted our application to run in the Windows 2008 server environment. The “Target Framework” in each of our projects is set to the “.NET Framework 4.0”. Our application works fine on my Windows 7 developer workstation. That is, I am able to receive messages from our WCF service, but when I place our application onto our Windows 2008 server and I attempt to run the application, I receive the following error message:
“There was no endpoint listening at http:// 126.221.97.105:701/CmesCns/CALLBACK/56281/7392d27a-e4a0-42e2-89a3-adc332e28934 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.”
The http namespace (http://+:701/) exists on my developer workstation and on my Windows 2008 server. The group “Everyone” is tied the namespace on my Windows 7 box and on my Windows 2008 server, and all of the access permissions are checked (GenericAll, GenericExecute, GenericRead, and GenericWrite).
Our team has been trying to resolve this error but we are unable to do so. Would anybody have any ideas on why this would work on our Windows 7 workstations, but not on our Windows 2008 servers?
Any help is greatly appreciated!
Kevin
|
|
|
|
|
hi i am wondering if its possible to include a patch like .net framwork 4 or ms agent hotfix in a application setup wizard.? hence user dont need to install seperately
|
|
|
|
|
neodeaths wrote: if its possible to include a patch like .net framwork 4
That's not a "patch", but a prerequisite; the app will need the framework (which is a new version, not a patch on 3.5) and the wizard can include those. We got an article on the subject[^].
As for MS-agent hotfixes; if they are executable files, you could include them as a "custom action", described here[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Following code snippet may look weird, but it is a very simple method to reproduce the problem of a complicated interaction with a different application.
The example application has two forms, both forms register FormClosing and FormClosed events, just doing a Debug.WriteLine there.
The Main function does:
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form2 form2 = new Form2();
form2.Show();
Application.Run(new Form1());
}
When I close Form2, I receive the events as expected. When I close Form1, the application exits and Form2 gets closed too. But: the events of Form2 do not occur.
I overrode the WndProc of Form2. When I close Form2, I receive
15.10.2012 10:25:04 WndProc - WM_CLOSE
15.10.2012 10:25:04 OnClosing
15.10.2012 10:25:04 Form2_FormClosing
15.10.2012 10:25:04 OnClosed
15.10.2012 10:25:04 Form2_FormClosed
...
15.10.2012 10:25:04 WndProc - WM_DESTROY
...
15.10.2012 10:25:04 WndProc - WM_NCDESTROY
When I close Form1, Form2 does not receive a WM_CLOSE. But WM_DESTROY and WM_NCDESTROY are received.
What is the reason for that strange behavior?
|
|
|
|
|
Bernhard Hiller wrote: What is the reason for that strange behavior?
Form1 is the MainForm. When it closes, the application terminates.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello
I have been programming for something like 3 years in VBA - Excel and trying to move to VB.Net, The reason I want to move to .Net is basically because of security issues (I really enjoy programming to help excel users) and because I believe for sure that using .Net framework is a more robust platform and I will be able to keep working with excel users and also start programming new things.
I need some clarification about .Net Framework security. I have been searching the web the last week reading and understanding how I can protect connection strings and realize (I think) that the best way is by encrypting the app.config connectionstring section.
But now I am really frustrated because I made a very simple test and then I myself tried to hack my application and it was very, very simple to reveal the connection strings.
The reason I am asking is because may be I am misunderstanding something and I want to clarify if it is really that simple to hack the connection strings? And obviously get advice if I am doing something wrong…?
If I am right…, let me ask you if there is a way to really protect a connection string from being read in a windows application that will be in the user computer?
I also think and to encrypt a simple .xml (Not an app.config) with the connection strings but this will be useless because in order my app can decrypt the .xml, the app needs to have the decryption sub inside the .exe or a .dll and with any decomplier a hacker can read the code and copy the decrypt sub to decrypt the .xml.
I have also read there are a lot of code ofuscators but they are expensive and at this point I only want to know if it possible to really protect a connection string.
Please HELP… I am getting mad trying to figure it out!!!
Let me explain the test I did:
1.- Create a windows test app with 2 buttons and 1 app.config
App.config:
<?xml version='1.0' encoding='utf-8'?>
<configuration>
<connectionStrings>
<add name ="sourcepath" connectionString ="valid url path"/>
<add name ="finalpath" connectionString ="valid desktop path"/>
</connectionStrings>
</configuration>
Button 1:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Try
Dim path As String =ConfigurationManager.ConnectionStrings("sourcepath").ConnectionString
Dim path1 As String = ConfigurationManager.ConnectionStrings("finalpath").ConnectionString
' Download file from web server to my desktop
Dim fileReader As New WebClient()
fileReader.DownloadFile(path, path1)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Button 2: I just copy ToggleConfigEncryption sub from http://msdn.microsoft.com
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Call ToggleConfigEncryption("WindowsApplication4.exe"
End Sub
Sub ToggleConfigEncryption(ByVal exeConfigName As String)
' Takes the executable file name without the .config extension.
Try
' Open the configuration file and retrieve
' the connectionStrings section.
Dim config As Configuration = ConfigurationManager. _
OpenExeConfiguration(exeConfigName)
Dim section As ConnectionStringsSection = DirectCast( _
config.GetSection("connectionStrings"), ConnectionStringsSection)
If section.SectionInformation.IsProtected Then
' Remove encryption.
section.SectionInformation.UnprotectSection()
Else
' Encrypt the section.
section.SectionInformation.ProtectSection( _
"DataProtectionConfigurationProvider")
End If
' Save the current configuration.
config.Save()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
2.- Run app, press button 2 to encrypt app.config connectionstrings section, press button 1 to download file, open app.config with notepad and verify the section is encrypted. So far, so good!!!
Now to hack my own app did the following.
1.- Download JustDecomile a free .Net decoder from internet
2.- Open my app with Just Decompile and I was able to read from button 1:
Dim path As String =ConfigurationManager.ConnectionStrings("sourcepath").ConnectionString
Dim path1 As String = ConfigurationManager.ConnectionStrings("finalpath").ConnectionString
3.- create a new app with following code: (I just copy paste from Just Decompile to new app and add msgbox line)
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim path As String = ConfigurationManager.ConnectionStrings("sourcepath").ConnectionString
Dim path1 As String = ConfigurationManager.ConnectionStrings("finalpath").ConnectionString
MsgBox(path & " " & path1)
End Sub
4.- Compile the new application.
5.- Copy the new application to test app directory
6.- Rename the new application with same name as test app (Maybe not necessary)
7.- Run the new app and I got a message box with the connection strings in 100% readable text!!!
|
|
|
|
|
Perhaps this article might be helpful:
Securing Connection Strings[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thanks for answer Richard. I have already read that article and as far as I understand it takes me again to encrypt the way I already did but I know encryption is not an easy issue and I am reviewing again the articule and see if I miss something. I will let you know.
|
|
|
|
|
Did you hack your program by going into the dll?
Well that works well, you need to obfuscate your dll and protect your code look up dotobfuscator
|
|
|
|