|
JoeRip wrote: what is the difference between a module and an assembly?
You're missing the question-icon, most forum-members will assume it's an answer to the original question and skip reading the post. To answer;
A module is a portable executable file, such as type.dll or application.exe, consisting of one or more classes and interfaces. There may be multiple namespaces contained in a single module, and a namespace may span multiple modules.
In short, an assembly can contain multiple modules (not to be confused with the VB.NET concept of a Module, which is a static class).
The code below shows an example of how to use the StackTrace-class, as proposed by another poster;
Dim mod = New System.Diagnostics.StackTrace().GetFrame(0).GetMethod()
Console.WriteLine (mod.Module)
Console.WriteLine (mod.Name)
Hope this helps a bit
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
You probably don't need to use GetModule() or GetAssembly() methods
Try the FullName property...
|
|
|
|
|
Try GetType() .
Object.GetType() [^] should give you the appropriate results.
|
|
|
|
|
In that moment, it is again application X which is executing, not Dll Y.
I do not understand what are trying to achieve, i.e. the objective behind finding out that a function was called from Y.
In case that the callback method is an event handler, you could use the "sender " parameter to get more information on the origin.
Another possibility is the StackTrace .
|
|
|
|
|
I want to send sms through asp.net. Can anybody give me working code please.I want it urgent
|
|
|
|
|
1. Your question would be better posted to the ASP.NET forum
2. If you want it urgent then perhaps a Google search would be a good idea.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
This has been posted in the C# forum and (correctly) int the ASP forum.
|
|
|
|
|
hi guys im new to programming in C# asp.net,how to write to a textfile automatically ?
|
|
|
|
|
You need to give us more details than that. When you say writing to the textfile automatically, what exactly do you mean by that? When would you write to the text file? What information are you writing? Is it logging information you are concerned about.
Plus, when posting a question about ASP.NET, please use the ASP.NET forum.
|
|
|
|
|
S'boh wrote: hi guys im new to programming in C# asp.net,how to write to a textfile automatically ?
Wrong approach; if you want to learn to program, then yes, basic IO would be the best place to start. However, asking how to do a specific task on a forum is not the best way to learn.
You start with this[^] page, and after you created your first app, you move on to How Do I[^] section of the documentation.
Alternatively, you can get a decent book.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello Friends i have a situation i created a signature pad with the mouse drawing when i save the image once lets say just sign and save it does save the image but if i have to re-sign lets say signature is wrong when it clears and sign again it only saves a "black box" it doesn't save the actual new signature
well i will leave the code of what i have now
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Net
Imports System.Globalization
Imports System.Threading
Public Class Form1
Private mousePath As New System.Drawing.Drawing2D.GraphicsPath()
Dim down As Boolean = False
Private Sub signature_MouseDown(ByVal sender As System.Object, ByVal e As MouseEventArgs) Handles signature.MouseDown
If e.Button = MouseButtons.Left Then
mousePath.StartFigure()
End If
If e.Button = MouseButtons.Right Then
mousePath.Reset()
End If
End Sub
Dim gfx As Graphics
Private Sub signature_MouseMove(ByVal sender As System.Object, ByVal e As MouseEventArgs) Handles signature.MouseMove
If e.Button = MouseButtons.Left Then
Try
mousePath.AddLine(e.X, e.Y, e.X, e.Y)
Dim CurrentPen = New Pen(Color.Black, 2)
gfx.DrawPath(CurrentPen, mousePath)
Catch ex As Exception
MsgBox("Signature Error")
End Try
If e.Button = MouseButtons.Right Then
Try
mousePath.Reset()
Catch ex As Exception
MsgBox("not deleting")
End Try
End If
End If
signature.Invalidate()
End Sub
Private Sub signature_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles signature.MouseUp
down = False
End Sub
Private Sub signature_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles signature.Paint
Try
Dim CurrentPen = New Pen(Color.Black, 2)
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
e.Graphics.DrawPath(CurrentPen, mousePath)
Catch ex As Exception
MsgBox("Error In Signature")
End Try
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Try
signature.Image.Save("C:\test\test1111111.Png") 'saved in app folder
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
signature.Image = New Bitmap(signature.Width, signature.Height)
gfx = Graphics.FromImage(signature.Image)
gfx.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
signature.Image = New Bitmap(signature.Width, signature.Height)
mousePath.Reset()
End Sub
End Class
Any help will be EXCELLENT !!! ,, Thanks Friends
|
|
|
|
|
hey hey found the error is the current pen has to be out of the private sub and only load the gfx and take the e.Graphics out ..
and it shud work fine if anyone needs it i have the source code and project
Thanks =)
|
|
|
|
|
Ahh, the PictureBox control. It's like putting Crayons in the hand of Leonardo da Vinci!
|
|
|
|
|
i want to remove folder in webserver. But Server is returning "550" error if folder is not empty.
i can delete files listing folder. But folders may includes sub folders. How can i get list of subfolders? Is there a simple way to delete non-empty folder?
<pre lang="vb">Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create(ftp://ftp.server.com/), System.Net.FtpWebRequest)
clsRequest.Credentials = New System.Net.NetworkCredential(username, pass)
clsRequest.KeepAlive = True
clsRequest.Method = System.Net.WebRequestMethods.Ftp.RemoveDirectory
Dim response As FtpWebResponse = CType(clsRequest.GetResponse, FtpWebResponse)
response.Close()
|
|
|
|
|
ulasoc wrote: How can i get list of subfolders?
Follow the example here[^].
ulasoc wrote: Is there a simple way to delete non-empty folder?
AFAIK, there is no "deltree" in FTP.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
If i want a simple server to client communication as a background service on windows Os, that would only send ISP infor to a hosted domain, WHERE would i start? C# of VB.net or other? Which has an example or godd start?
Experience is the best teacher
|
|
|
|
|
You would not start with either, the language is not the issue. I'm not quite sure exactly what you are trying to do, but you may want to investigate the Windows Communication Foundation[^] for this sort of project.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Private Sub EncryptOrDecryptFile(ByVal jitfInputFile As String, _
ByVal jitfOutputFile As String, _
ByVal jitfKey() As Byte, _
ByVal jitfIV() As Byte, _
ByVal Direction As CryptoAction)
fsInput = New FileStream(jitfInputFile, FileMode.Open, FileAccess.Read)
fsOutPut = New FileStream(jitfOutputFile, FileMode.OpenOrCreate, FileAccess.Read)
fsOutPut.SetLength(0)
it give me an error saying fs.OutPut.SetLength(0)
Private Sub EncryptOrDecryptFile(ByVal jitfInputFile As String, _
ByVal jitfOutputFile As String, _
ByVal jitfKey() As Byte, _
ByVal jitfIV() As Byte, _
ByVal Direction As CryptoAction)
fsInput = New FileStream(jitfInputFile, FileMode.Open, FileAccess.Read)
fsOutPut = New FileStream(jitfOutputFile, FileMode.OpenOrCreate, FileAccess.Read)
fsOutPut.SetLength(0)
Getting an error when i click "Encrypt" says Stream Doest Not Support Writting. ..
inside the Buttom Click i have this
EncryptOrDecryptFile("C:\ProgramData\JITFapp\" & savexml, "C:\ProgramData\JITFapp\" & savexml + ".crypted", jitfKey, jitfIV, CryptoAction.ActionDencrypt)
Any Ideas
|
|
|
|
|
Your specifying FileAccess.Read[^] when opening the output file:
fsOutPut = New FileStream(jitfOutputFile, FileMode.OpenOrCreate, FileAccess.Read) Change FileAccess.Read to FileAccess.Write or FileAccess.ReadWrite and it should work.
fsOutPut = New FileStream(jitfOutputFile, FileMode.OpenOrCreate, FileAccess.Write)
0100000101101110011001000111001011101001
|
|
|
|
|
i didnt see that .. ok doing the change lets take a look it shud work perfect now =)
|
|
|
|
|
please reply fast.....for this question
|
|
|
|
|
public bool MyBool { get; set; }
Private _myBool As Boolean
Property MyBool() As Boolean
Get
Return _myBool
End Get
Set(ByVal Value As Boolean)
_myBool = Value
End Set
End Property
ankita.rose9 wrote: please reply fast.....for this question
..and where did you find the right to hurry me? Am I being paid by your company?
If you need this information "quick", I suggest studying; a property is a very basic construction, and studying makes sure that you can remember how to use it once you need it. Seriously, Google it, you'll find that it's nigh impossible to miss the examples.
Now, you're probably facing some other issue, like initializing this property correctly and/or getting it nicely in the propertygrid. If that's the case, change your question to reflect the actual problem.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello -
In one hand, I have a form which contains a DataGridView. Clearly, the DGV is running on the UI thread.
In the other hand, I have an library object, which contains a DataTable. That datatable is updated by an internal System.Threading.Timer (not a form timer). A couple of times a second, a row is added to that table.
Once I set the DataSource of the DataGridView to be the DataTable of that library object, the DGV never redraws. The data is there, it just doesn't draw.
The problem is that the DataTable is being updated by a different thread than the UI thread (verified). Apparently, the "your data has changed" methods of the DGV are also being called on that other thread.
So: how do I avoid this? Since the update mechanisms are private to the DataSource/Binding mechanism, there is no clear place where I can use Invoke to sync the datatable with the UI thread, so I can cross the thread boundary safely.
I do own the library object. I am currently exposing the DataTable as a public object. Is there another way to get the data in the table to the DGV, in a way that crosses the thread boundary safely?
|
|
|
|
|
there may be a couple of options for you that i can think of straight away you can either Invoke the Add calls on the UI thread, or after everything has been added you can Invoke a mothod that triggers a refresh. I'm not very familiar with how this is done on winforms, but you can call invoke i believe on any control create on the UI thread.
so something like
dgv.Invoke(new Action(() =>
{
var toAdd = dt.NewRow();
dt.Rows.Add(toAdd);
}));
This may not be the neatest way but hopefully it should be a start for you. If you need a more tailored answer to your problem pop up a code sample and i'll take a look.
|
|
|
|
|
JoeRip wrote: So: how do I avoid this? Since the update mechanisms are private to the DataSource/Binding mechanism, there is no clear place where I can use Invoke to sync the datatable with the UI thread, so I can cross the thread boundary safely.
I do own the library object. I am currently exposing the DataTable as a public object. Is there another way to get the data in the table to the DGV, in a way that crosses the thread boundary safely?
MSDN has a how-to[^] on the subject. The annoying part is updating the grid if you have the new data, and this works best if the grid is in virtual mode[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|