|
I have recently created a program that I want to hide the source code of.
Is they're some code i can include in my program that will encrypt the source code or will i have to get some software that will do this for me?
Ps I am using vb.net 2003
|
|
|
|
|
You can't hide the source code, but you can obfuscate it. A community-edition obfuscator comes with the full versions of Visual Studio. There is a professional version, but costs $$, as does many others. All you have to do Google for ".NET obfuscate".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
when i try to render the report from web app by using web service (ReportingService) i have this big error
Exception Details:
===================
System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: The permissions granted to user 'NT AUTHORITY\NETWORK SERVICE' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.RSException: The permissions granted to user 'NT AUTHORITY\NETWORK SERVICE' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'NT AUTHORITY\NETWORK SERVICE' are insufficient for performing this operation. at Microsoft.ReportingServices.Library.RSService._GetReportParameterDefinitionFromCatalog(CatalogItemContext reportContext, String historyID, Boolean forRendering, Guid& reportID, Int32& executionOption, String& savedParametersXml, ReportSnapshot& compiledDefinition, ReportSnapshot& snapshotData, Guid& linkID, DateTime& historyDate) at Microsoft.ReportingServices.Library.RSService._GetReportParameters(String report, String historyID, Boolean forRendering, NameValueCollection values, DatasourceCredentialsCollection credentials) at Microsoft.ReportingServices.Library.RSService.RenderAsLiveOrSnapshot(CatalogItemContext reportContext, ClientRequest session, Warning[]& warnings, ParameterInfoCollection& effectiveParameters) at Microsoft.ReportingServices.Library.RSService.RenderFirst(CatalogItemContext reportContext, ClientRequest session, Warning[]& warnings, ParameterInfoCollection& effectiveParameters, String[]& secondaryStreamNames) at Microsoft.ReportingServices.Library.RenderFirstCancelableStep.Execute() at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper() --- End of inner exception stack trace --- at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper() at Microsoft.ReportingServices.Library.RenderFirstCancelableStep.RenderFirst(RSService rs, CatalogItemContext reportContext, ClientRequest session, JobTypeEnum type, Warning[]& warnings, ParameterInfoCollection& effectiveParameters, String[]& secondaryStreamNames) at Microsoft.ReportingServices.WebServer.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, Byte[]& Result, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds) --- End of inner exception stack trace --- at Microsoft.ReportingServices.WebServer.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, Byte[]& Result, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds)
|
|
|
|
|
Hi all,
I am looking for a bit of guidance for using a checkboxlist in Visual Studio 2005. I am wanting to use this to have each checkbox set to checked or unchecked, depending on a value contained in the registry. I have 10 items in the list at the moment.
Here[^] is a screenshot of what I currently have.
Any help on setting the checked state and checking the state of each individual checkbox within the list will be greatly appreciated.
Thanks, Andrew Robinson
|
|
|
|
|
Does anyone know where I can find a (preferably free) telnet component for .NET that will do 5250, wyse 50, and VT320 emulation? It does not have to do all three, but I need to use all three emulations.
|
|
|
|
|
.net 2003
I have a form with 1 button and several labels on it. I don't want the button to be the default if enter is pressed. I want the user to have to actually click it for it to work. I also don't want it to have that "selected" look with the dotted line around the text. What can I do about all this? Thanks.
|
|
|
|
|
1 - set the focus to another control
2 - write some owner drawn code, or download some from code project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a simple vb.net gui application (an alternative file requester in a form) that I would like to run from the command line. It executes fine, but I find that I cannot send any output (a string representing the file selected) to the command line upon completion. It appears that "console.writeline" doesn't actually write to the console? Any suggestions as to how to send info back to the console window upon completion? Keep in mind that this is a gui app (not straight console).
|
|
|
|
|
First, what verison of VB.NET are you using?
Let's see the code that created your console and the code that is trying to write to it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
vb.net 2005.
As for "code that created the console", I'm not sure of what you are asking: For testing, I'm creating a standard windows form application (hence as I mentioned it being gui-based and not console-based). Call it MyApp for discussion sake. Somewhere in the code (in this case within the Form_Load event) I have placed a console.writeline("hello world") statement. I was expecting this to display to the console when the program is run from a console, such as:
c:\>MyApp
and display
hello world
accordingly. However, nothing is ever displayed on the command line after the program quits. I'm guessing at this point that console.writeline doesn't really write to the console if the app is gui/form based, even if it is called from the command line....?
|
|
|
|
|
smarr wrote: I was expecting this to display to the console when the program is run from a console
Doesn't work that way. The console is not part of the process you launched and has absolutely nothing to do with the process at all, at any point in time. You can have multiple consoles open at once, so that app has no way of knowing which one to write to!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'll wait to respond until I've sure you've read the second response I made....I don't think I was being very clear previously. I'm pretty sure that my vb task should be able to respond to the parent shell window...just not sure how
|
|
|
|
|
smarr wrote: I'm pretty sure that my vb task should be able to respond to the parent shell window
No, it can't. Not unless you specifically go and get a handle for any existing console window. It's just easier to create your own...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Upon rereading your post, a light went on in my head. You might be assuming that *I* am creating the console in which my code is running. The console is a standard DOS shell (cmd.exe) that is run by the user. *My Application*, while gui-based, is being run from that command shell as a commandline. I'm trying to get my app to print text to the shell from which it was called. In C, the closest thing would be a printf().
Hope that helps....
|
|
|
|
|
If you don't create the Console window, or at least grab a handle to an existing console window, you can't write to it.
smarr wrote: I'm trying to get my app to print text to the shell from which it was called. In C, the closest thing would be a printf().
Since you created a Windows Forms app, there is no such thing as a console that is attached to it automatically. Your app has to create one, or find an existing one. This was easy in C because your C apps were console-based, non-GUI apps and ran in the context of the DOS-emulator running in that console window. The consoles Standard In/Out/Error streams are at the disposable of the console app that is launched. This concept doesn't apply to Windows Forms apps since it has no use for those streams.
You can create your own Console window using:
Declare Auto Function AllocConsole Lib "kernel32" () As IntPtr
.
.
.
AllocConsole()
Console.WriteLine("This is a test...")
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hate to keep repeating it, but I cannot create the console: It needs to be an existing shell in which the user executes the gui app, then the string is returned to the (same) shell. It's like the event handlers injected into a gui app disable the "console-ness" of it.
|
|
|
|
|
OK. Well, the console you launch your app from is not attached in any way shape or form to a Windows Forms app. In other words, the parent process of the Windows Forms app is NOT the console process that launched it. There is no way for a Windows Forms app to know which console window launched it. It's exactly the same as if you launched it by double clicking the icon or typed its command line into Start/Run.
So, the only way to get the console window attached to your app upon launch is if you write your app as a Console Application, then create and launch your Form using Application.Run() . You'll have to create public properties in your form so you can get any return values out of it. Something like this:
Imports System
Imports System.Windows.Forms
Module Module1
Sub Main()
Dim myForm As New Form1
Console.WriteLine("Application startup...")
' Application.Run is a blocking call...
System.Windows.Forms.Application.Run(myForm)
' so, this statement won't execute until the form is closed.
Console.WriteLine(myForm.ReturnValue)
End Sub
End Module
Public Class Form1
Inherits Form
Shared Sub Main()
End Sub
Private _returnValue As String
Public ReadOnly Property ReturnValue() As String
Get
Return _returnValue
End Get
End Property
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Console.WriteLine("You can write from the console from inside your form.")
_returnValue = "This is the return value stored in the form..."
End Sub
End Class
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I now have an alternative.....Dave, this may be similiar to what you are suggesting, although it does seem to work despite some of the issues you raised. Someone on another list suggested changing the apptype to Console App *after* the app has already been created.
I didn't want to change the app drastically and get involved with the whole main/app.run stuff. Plus, I have several utility programs that can benefit from this. Apparently by creating the app normally (as a windows application) and using console.writeline to write to the IDE console for debugging can be the starting point. Afterwards, the app type can be changed (in the IDE Properties for the project) to Console Application. At this point, all the existing infrastructure still works, but console.writeline will now output to something other than the IDE console window. If the app is run from the IDE, it will automatically create a shell window and output to that. However, if the app is run from an existing shell, output will be sent to that window (as expected since this is the shell window that spawned the app) and the app runs as a gui-based application.
The best of both worlds.
The only bad side is that if the app is run from an icon, it will open a shell for it's output. This is acceptable for me since the app will always be run from an existing shell app.
Thanks for the help Dave!
|
|
|
|
|
You can do that. All you're doing is changing the startup code environment. How you're launching the form code (automatically in your case) is very similar to what I put up in the last post. The results look exactly the same, right down to the console window popping up if you double-click the icon. Now you know how to do it yourself instead of relying on a procedure that might not work in the next version of VS.NET.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sir,
I want to apply password to the file/folder with the help of my application .Please suggest some tutorials for that.Last time i was told to get the knowledge up to black belt, device drivers, file extentions.But i was not suggested where to study these things online.Please suggest any online link .I want to start from the scratch.
Thanks
|
|
|
|
|
This is really a black art, and resources on the topic are few. Try typing "windows driver development[^]" into Google.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to use vb.net changing the registry of HKEY_CURRENT_USER "Control panel\colors" for each color?
Thank you.
Beginner
|
|
|
|
|
All of the values in that key are merely strings that represent RGB values to build a color. The first number in each string is the Red component, in the range 0 to 255. The second number is Green and the thrid number is Blue. ALl you have to do is build a string with those numbers and update the value in the registry.
You can learn more about using the Registry and RegistryKey classes here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much.
if i use this function to run that always hava an error message:
RegCreateKeyEx(HKEY_CURRENT_USER, "Control Panel\Colors", 0, vbNullString, _
REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, vbNullString, hKey, 0)
error message:
Additional information: Error: PInvoke item (field,method) must be Static.
how to fix the problems? or use the different the funcutions?
Thanks.
-- modified at 14:22 Monday 18th September, 2006
Beginner
|
|
|
|
|
Why are you P/Invoking Win32 functions when the Registry and RegistryKey classes already do all this for you?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|