|
Can you suggest to me an encrypting library that I can use or something else ?
( And to better clarify what I want , when the user upload the file , I want to save this file in some folder , but the user should not be able to open this file from windows explorer or from other programs, but only when he try to open from within my application )
|
|
|
|
|
Like hijacking the data?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Just Google for "VB.NET encrypt decrypt file". You'll come up with tons of examples.
|
|
|
|
|
In an existing vb.net 2010 application that accesses a sql server 2012 database, I only want to modify the exsiting sql to add a comment saying what
cs.attributeID = 2775 and cs.attributeID = 2771 means in the following sql right next to the line where the sql actually exists.
Const sql As String = "SELECT CS2775.Personid,SchoolYearValue,SchoolYearName,CS2775.StatusDateTime " _
& " from " _
& "(SELECT cs.Personid,cs.value as SchoolYearValue, cd.name as SchoolYearName , [date] AS StatusDateTime " _
& " FROM TEST.DBO.customstudent cs WITH (NOLOCK)" _
& " JOIN TEST.DBO.CampusDictiONary cd " _
& " ON cs.attributeid = cd.attributeID AND cs.value =cd.code" _
& " WHERE cs.attributeID = 2775 " _
& " GROUP BY personID, cs.value, cd.value,name,[date]) as CS2775 " _
& " LEFT JOIN (SELECT Personid,value as Edcounsel1CP, max([date]) AS StatusDateTime " _
& " FROM TEST.DBO.customstudent WITH (NOLOCK)" _
& " WHERE attributeID = 2771 " _
& " GROUP BY personID, value ) as CS2771 " _
& " ON CS2771.PersonID = CS2775.Personid " _
& " AND CS2771.StatusDateTime = CS2775.StatusDateTime " _
& " WHERE CS2775.Personid = @studentlink ; "
I want to make this change since I am adding more 2 attribute values to an extensive long list of existing attribute values. Management would
not let me change the existing sql since it is not cost effective.
The only thing I know what to do is to place the comments prior to the string assignment statement. Thus would you show me the code of how I can add
the comments I would like to place in the sql listed
|
|
|
|
|
Assuming you want the comments in VB, and not in the actual query:
However, if you're using Visual Studio 2010 or later, you don't actually need the line continuation character. You just need to move the & from the start of the line to the end of the previous line:
Const sql As String = "SELECT CS2775.Personid,SchoolYearValue,SchoolYearName,CS2775.StatusDateTime " &
" from " &
"(SELECT cs.Personid,cs.value as SchoolYearValue, cd.name as SchoolYearName , [date] AS StatusDateTime " &
" FROM TEST.DBO.customstudent cs WITH (NOLOCK)" &
" JOIN TEST.DBO.CampusDictiONary cd " &
" ON cs.attributeid = cd.attributeID AND cs.value =cd.code" &
" WHERE cs.attributeID = 2775 " &
" GROUP BY personID, cs.value, cd.value,name,[date]) as CS2775 " &
" LEFT JOIN (SELECT Personid,value as Edcounsel1CP, max([date]) AS StatusDateTime " &
" FROM TEST.DBO.customstudent WITH (NOLOCK)" &
" WHERE attributeID = 2771 " &
" GROUP BY personID, value ) as CS2771 " &
" ON CS2771.PersonID = CS2775.Personid " &
" AND CS2771.StatusDateTime = CS2775.StatusDateTime " &
" WHERE CS2775.Personid = @studentlink ; "
If you do want the comments to be part of the query, then you'll need to use SQL's multi-line comment syntax:
& " WHERE cs.attributeID = 2775 /* A comment */ " _
You can't use the single-line comment syntax, because your query is all on one line, and everything after the comment would also be commented out.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks that works well!
|
|
|
|
|
I have an application that populates an Adobe form using iTextSharp, then launches the form in a new Adobe window. The issue I'm running into is that Adobe Acrobat 11 crashes when opening the file.
Dim p As New Process
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal
p.StartInfo.FileName = AdobePath
p.StartInfo.Arguments = String.Format("/n {0}{1}{0}", Chr(34), SaveFilePath)
p.Start()
The interesting thing is that Adobe opens fine if there's a message box before the Start method. As soon as I remove the message box, Adobe goes back to crashing when loading the PDF.
I thought that maybe there was a situation where the file hadn't finished writing or closing, so I replaced the message box call with a sleep statement. The sleep statement, regardless of how long I have it wait, still results in Adobe crashing.
The code has been used for years across multiple versions of Adobe Acrobat and Reader. There have been no issues until the business started updating users to Adobe Acrobat 11.
Additionally, the file opens fine manually even when emulating the start process by using the command line or a shortcut.
|
|
|
|
|
in making written answer question paper.i used textbox to submit the answer.then check answers through the if satement and i want to take sum of correct answers this is code for one questio that i used,
Private Sub CommandButton1_Click()
If TextBox1.Text = "8" Then
numberCorrect = numberCorrect + 1
MsgBox "wel done"
SlideShowWindows(Index:=1).View.Next
Else
numberWrong = numberWrong + 1
MsgBox "Try again"
End If
TextBox1.Text = ""
End Sub
|
|
|
|
|
And what is your question?
|
|
|
|
|
I have a windows forms vb.net application (VS210) that automates a process simulator. I have an old version of the simulator application on my development machine, so I reference the com library at design time. However, my clients will have a newer version of the library. So, how do I use a config file to add the reference at runtime?
Maybe you can give an example or a reference. I couldn't understand what I got from Microsoft.
|
|
|
|
|
Hello dear everyone. I came up with creating an app that displaying the signal bar strength of the network that i am connected with. I can't find any site that guiding to code it in VB.Net so I unable to start with any of it. Could anyone suggest me which site that I can use to learn or maybe you can provide some suggestion on how to start with it? Thank you so much.
|
|
|
|
|
|
This is one of the forum that I think related to what I am looking for WMI to get SSID and signal strength information - Visual Basic .NET[^] but I am lost because I don't really know where to start. For example I don't understand about the WMI. I though it is clear enough if I mention about Display network signal strength using windows form application.
|
|
|
|
|
|
Sure, thanks
|
|
|
|
|
Hello everybody,
I could youse some help with VBA.
The case is: I have a folder with lots of Outlook .msg files and I need to extract their metadata like Subject, Sender and Send date to an Excel spreadsheet.
I am new in VBA and I would be very grateful for any advice you could give me! Thank you!
With Best Regards
Alex
|
|
|
|
|
I found this code:
Sub GetMailInfo()
Dim MyOutlook As Outlook.Application
Dim msg As Outlook.MailItem
Dim x As NameSpace
Dim Path As String
Dim i As Long
Set MyOutlook = New Outlook.Application
Set x = MyOutlook.GetNamespace("MAPI")
Path = "C:\Users\Alexander.Scott-Zhuk\Desktop\Messages\"
FileList = GetFileList(Path + "*.msg")
Row = 1
While Row <= UBound(FileList)
Set msg = x.OpenSharedItem(Path + FileList(Row))
Cells(Row + 1, 1) = msg.Subject
Cells(Row + 1, 2) = msg.SenderName
Cells(Row + 1, 3) = msg.SenderEmailAddress
Cells(Row + 1, 4) = msg.CC
Cells(Row + 1, 5) = msg.To
Cells(Row + 1, 6) = msg.SentOn
Cells(Row + 1, 7) = msg.Size
If msg.Attachments.Count > 0 Then
For i = 1 To msg.Attachments.Count
Cells(Row + 1, 7 + i) = msg.Attachments.Item(i).FileName
Next i
End If
Row = Row + 1
Wend
End Sub
Function GetFileList(FileSpec As String) As Variant
Dim FileArray() As Variant
Dim FileCount As Integer
Dim FileName As String
On Error GoTo NoFilesFound
FileCount = 0
FileName = Dir(FileSpec)
If FileName = "" Then GoTo NoFilesFound
Do While FileName <> ""
FileCount = FileCount + 1
ReDim Preserve FileArray(1 To FileCount)
FileArray(FileCount) = FileName
FileName = Dir()
Loop
GetFileList = FileArray
Exit Function
NoFilesFound:
GetFileList = False
End Function
But it doesn't work for me. When I run the macro I receive a runtime error message:
"runtime error 1004 method 'cells' of object '_global' failed"
and when I click debug it highlights this line:
Cells(Row + 1, 1) = msg.Subject
Do you have any clue, what am I doing wrong? Please help!
|
|
|
|
|
Are you running this from within an open Excel workbook?
|
|
|
|
|
Hello Richard,
no, I actually was running the macro from Outlook-VBA, but thank you for pointing me on that. I copied the code into the Excel-VBA and it worked perfectly! Thank you a lot!
But I still have the question, how do I make it work from Outlook and save it into Excel-File?
Alexander
|
|
|
|
|
At the beginning of the macro you have some code like:
Dim MyOutlook As Outlook.Application
Dim msg As Outlook.MailItem
Dim x As NameSpace
which starts the Outlook application and sets some references. If you want to run it from Outlook then you need some similar code that loads the Excel application and creates a new workbook. I do not know the exact code but take a look at Application Object (Excel)[^].
|
|
|
|
|
Ok thanks for your advise, I will look at this article closer.
|
|
|
|
|
Good day friends! Please, am currently working on a game and am having a challenge. I want enemies to appear smaller when far from the player and bigger when closer. Any solution is welcome please.
|
|
|
|
|
Since we know NOTHING AT ALL about your game, it's implementation, raster or vector graphics, ..., it's pretty much impossible for anyone to tell you anything useful.
Well...other than Google for "scaling 2d raster graphics" or something similar depending on your implementation.
|
|
|
|
|
Hello and thnx in advance for the help.
I have to send a packet of data, to the network broadcast, using UDP, to get the members of this particular intranet to respond (they are all PLCs).
I know the hex format of the message, say:
""43:44:50:00:01:00:00:00:00:00:00:00:00:ff:00:00:00:00:00:00:00:03:00:06:00:00:00:28:c0:a8:fc:fa:00"
colons are byte separators.
How do I pack it into the command MSG?
Dim myIP as IPAddress = "some.ip.addr.255"
Dim myPort as Integer = someport
private const myCmd as string = "43:44:50:00:01:00:00:00:00:00:00:00:00:ff:00:00:00:00:00:00:00:03:00:06:00:00:00:28:c0:a8:fc:fa:00"
dim HexSplit() as string = split(myCmd, ":")
dim byteCMD as byte() = new byte()
dim lCounter as integer
for each hS in HexSplit
byteCmd(lcounter) = CByte(Val("&H" + hS))
lcounter += 1
next
udpClient.Connect(myIP, myPort)
mRet = udpClient.Send(byteCmd, byteCmd.length)
|
|
|
|
|