|
If the converted one compiles, then the conversion has done the job. That is what migration promises to do. The migration pretty much occurs to the project settings only. It won't upgrade your source code, nor does it add any new features that didn't exist before.
Best,
Jun
|
|
|
|
|
He's asking other ASP.NET questions, so that's the kind of project I think he's upgrading.
There's so much that's different between ASP.NET 1 and 2, that his project will more than likely break when he compiles it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I see. Forget about what I posted earlier.
Best,
Jun
|
|
|
|
|
is there any way
to call function automatically when webforms loads without writing each time
code at page load of each webforms.
|
|
|
|
|
You get a better response if you ask this question in the ASP.NET forum.
AFAIK, there is no event that fires for every request in every session.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
1. Create base page that calls the function.
2. Have all your pages inherit off of the base page.
Mike Lasseter
|
|
|
|
|
Create the function in a seperate module/class (depending on your requirement) and make the method call at page load, e.g.
Protected Sub Page_Load....
Dim MyClass1 As New MyClass 'declare the class
MyClass.DoFunction() 'do the work
End Sub
Is that what you mean?
Agree with Dave Kreskowiak - this topic is better off in ASP forum.
|
|
|
|
|
Hi,
I'm trying to build a more informative error log. Upon encountering an unexpected error, I'd like to get more information about the error to help me pin point its origin.
Specifically I'd like any/all of the following:
The line of code that caused the error
The Event Name, Function, or Sub that caused the error
The module that caused the error.
Thanks.
Ben
|
|
|
|
|
The best you can get is what you see in the StackTrace property of the Exception. You can get the name of the method from the top line of the StackTrace, or you can get it from the .TargetSite.Name property of the Exception. The module name will also come from the .TargetSite , but in its .DecalringType or ReflectedType properties.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi there:
As you know we can compile a C Sharp program at DOS prompt like
csc MyProgram.cs
Where MyProgram.cs is the source code file.
Now i want to perform the same compilation through another C Sharp Program. Like i made a program named ShellExecution, which tries to compile another C Sharp Source Code File called "First.cs" lying in my c directory. The program runs fine without any exceptions; it opens the dos window and runs csc, but nothing happens and seems like the file name "First.cs" is not being passed to the csc.exe as a parameter. I have used the following code for executing the compilation process:
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\CSC.exe";
process.StartInfo.Arguments = "C:\\First.cs";
process.StartInfo.UseShellExecute = true;
process.StartInfo.RedirectStandardOutput = false;
process.StartInfo.CreateNoWindow = false;
process.Start();
process.WaitForExit();
Please help me out!!!!
|
|
|
|
|
I don't know if it'll help any but I always use the Start() method by passing the arguments directly into the method call.
<br />
System.Process.Diagnostics.Start("CSC.exe", "C:\First.cs")<br />
Works eveytime for me.
-- modified at 6:14 Friday 25th August, 2006
|
|
|
|
|
I'm trying to delete a directory hierachy that contains a number of read only files, but the Directory.Delete(dirName, true) method throws an exception when it finds one. Is there an option to force it to do so, or a method that can recursively change the file atributes of every file in the folder? If not, iterating the tree and using the File.SetAtributes() method on each file individually would work, but I don't want ot unncessarily reinvent the wheel.
|
|
|
|
|
When I was faced with this same problems, I wrote an app to set the attributes for all files in a directory read to remove the read-only flag, then, I deleted the entire directory tree.
Private Function SetDirectoryTreeAttribute(ByVal sDirectory As String, ByVal lAttributes As FileAttribute) As Boolean<br />
<br />
Try<br />
For Each sFoundFile As String In My.Computer.FileSystem.GetFiles _<br />
(sDirectory, FileIO.SearchOption.SearchAllSubDirectories)<br />
File.SetAttributes(sFoundFile, lAttributes)<br />
System.Windows.Forms.Application.DoEvents()<br />
Next<br />
<br />
Catch ex As Exception<br />
Console.Write(ex.Message.ToString)<br />
Finally<br />
<br />
End Try<br />
<br />
Try<br />
For Each sFoundFile As String In My.Computer.FileSystem.GetDirectories _<br />
(sDirectory, FileIO.SearchOption.SearchAllSubDirectories)<br />
SetDirectoryTreeAttribute(sFoundFile, lAttributes)<br />
Next<br />
<br />
Catch ex As Exception<br />
Console.Write(ex.Message.ToString)<br />
<br />
Finally<br />
<br />
End Try<br />
<br />
End Function
Followed by...
My.Computer.FileSystem.DeleteDirectory (sFoundFile, FileIO.DeleteDirectoryOption.DeleteAllContents)
Hope that helps...
Tim
|
|
|
|
|
With the userform "selction" a filtre a data in a mdb...
After i insert a value similar 4500 in this userform and press selct automaticly the user form "modifiche" show with the data fileterd from selection form, but the code not work?????!!!!!
Note: change path of mdb
For test i have used only a textbox2
Sorry for my terrible English
attached file here:
http://www.mytempdir.com/883741
|
|
|
|
|
Is there any software out there that can compare Vb exes with one another?
|
|
|
|
|
Which version of VB and on what level do you want to compare them?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for getting back.
It is VB6.
What I want to know if there is any difference between 2 exes. The sort of thing like, if there has been a update, new compilation etc from the original exe.
Hope this helps, thanks again.
|
|
|
|
|
Is there anything for Vb.Net version 2003 as well?
|
|
|
|
|
Nothing that will compare two .EXE's. You'll have to look at each .EXE and compare them by hand. You can use Lutz Roeder's .NET Reflector[^] to do that.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
VB6? No, there isn't. VB6 compiles directly to a native image format binary. A simple FC compare will tell you that they are different. I'm not aware of any utility that dumps VB specific data out of the .EXE to compare with anything.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
See my test code below (VB .NET 2.0). The Dispatcher is kicking off separate threads of DownloadFileThread which uses the WebClient DownloadFile method to retrieve the files from the web server.
If I watch “c:\test” and keep hitting F5, I see that only two files are ever downloading at the same time. Based on extensive Google searches, I have tried the following, but I still only get 2 downloads at a time:
1. Set "MaxConnectionsPer1_0Server" and "MaxConnectionsPerServer" registry settings to greater than 2
2. Used HttpWebRequest instead of DownloadFile, setting “ServicePoint.ConnectionLimit” to greater than 2
3. Tried upping the “ServicePointManager.DefaultConnectionLimit” to greater than 2
Any help would be greatly appreciated!!
Public Sub Dispatcher()
Const MaxThreads As Integer = 3
Dim DownloadList As New Queue
DownloadList.Enqueue("http://localhost/gdsupdate/bigfile1.cab")
DownloadList.Enqueue("http://localhost/gdsupdate/bigfile2.cab")
DownloadList.Enqueue("http://localhost/gdsupdate/bigfile3.cab")
Dim ThreadList As New Collection
Dim stillWorking As Boolean
Dim CheckingThread As Threading.Thread
Do
'Check to see if it is still running
stillWorking = False
'Loop through the threads to remove those that are finished
For ThreadIdx As Integer = ThreadList.Count To 1 Step -1
CheckingThread = ThreadList.Item(ThreadIdx)
If CheckingThread.ThreadState = Threading.ThreadState.Aborted Or _
CheckingThread.ThreadState = Threading.ThreadState.Stopped Then
ThreadList.Remove(ThreadIdx)
Else
stillWorking = True
End If
Next
'Add more items to the threads if there is room and more to process
For ThreadIdx As Integer = (ThreadList.Count + 1) To MaxThreads
If DownloadList.Count = 0 Then Exit For
CheckingThread = New Threading.Thread(AddressOf DownloadFileThread)
ThreadList.Add(CheckingThread)
CheckingThread.Start(DownloadList.Dequeue)
stillWorking = True
Next
'Continue looping until all are completed
Loop While stillWorking
End Sub
'Thread must be a sub with 1 object as param (type must be object), or no param
Friend Sub DownloadFileThread(ByVal InputFile As Object)
Dim SourceURL As String = InputFile
Dim FileName As String = System.IO.Path.GetFileName(SourceURL)
Dim ToTarget As String = System.IO.Path.Combine("c:\test", FileName)
Dim theWeb As New System.Net.WebClient
theWeb.DownloadFile(SourceURL, ToTarget)
End Sub
|
|
|
|
|
Hi
I have installed a windows service successfully and it runs ok. When I attach to the process in order to debug it, and try setting breakpoints, I get the following message:
"The breakpoint will not currently be hit. No symbols have been loaded for this document"
Has anyone come across this before (and found a solution )?
Thanks
KevinSheedy
|
|
|
|
|
|
I have some source code written in c# but as I am a VB.NET programmer I need a little guidance in the translation.
Firstly would the following C# code snippet...
[Serializable]<br />
public class Employee
translaste to VB.NET as...
<Serializable> Public Class Employee()
Secondly
How would this translate from C# to VB.NET?
public class EmployeeCollection : ArrayList
Thanks
Steve Jowett
|
|
|
|
|
Just use this link
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
for converting C# code to VB.net code
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|