|
Please excuse me if this is not the correct forum for my question. I would like to know if I can prevent users from seeing the markups and scripts of my page if I display it in a Winform and calling Javascript from C#.
modified 20-Nov-18 1:17am.
|
|
|
|
|
They can see any request with fiddler. If you provide a WinForm, I will decompile that too.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You can't completely prevent the users of your site, no matter what they use as a browser, from seeing the markup and script code.
|
|
|
|
|
Depends on how sophisticated the "user" is.
You can start by trapping "right mouse clicks" ... to disable the context menu "popup" for "View Source".
Then go from there: transparent panels, keyboard lockouts, etc. (i.e. "kiosk" mode).
Transfer content encrypted and "serve locally" (to defeat "fiddling").
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
can any one help me to write this java function by vb.net
public static String HmacSha256Encode(String key, String data) {
try {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(Base64.decodeBase64(key.getBytes("UTF-8")),"HmacSHA256"); sha256_HMAC.init(secret_key);
return new String(Base64.encodeBase64(sha256_HMAC.doFinal(data.getBytes("UTF-8"))));
}catch (Exception e) {e.printStackTrace();
}
return null;
}
|
|
|
|
|
Try:
Public Shared Function HmacSha256Encode(ByVal key As String, ByVal data As String) As String
Dim secret_key As Byte() = Convert.FromBase64String(key)
Dim data_bytes As Byte() = Encoding.UTF8.GetBytes(data)
Using hash As New HMACSHA256(secret_key)
Dim result_bytes As Byte() = hash.ComputeHash(data_bytes)
Return Convert.ToBase64String(result_bytes)
End Using
End Function
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
Please help me how to add text from text file and put it on the datagridview here is my code:
Dim FileLine As String
Dim LineLength As Integer
Using sr As New StreamReader("C:\Users\WIN 7\Desktop\rmsbp050_09032018.txt")
While Not sr.EndOfStream
FileLine = sr.ReadLine()
LineLength = FileLine.Length
If LineLength = 59 Then
DataGridView1.Rows.Add(FileLine.ToString, sr.ReadLine() & vbNewLine, sr.ReadLine() & vbNewLine & vbNewLine, sr.ReadLine() & vbNewLine & vbNewLine & vbNewLine)
End If
End While
End Using
Here is the sample text file :
BANK NAME 15 CUSTOMER INFORMATION SYSTEM *RMR100 * PAGE NO 1
CTL 2 000 PNB SAVINGS BANK MONDAY PROCESS DATE 09/03/18
CTL 3 000 ACTIVITY *RM 100* PROCESS THRU 09/03/18
CTL 4 0000 CURRENT DATE 09/03/18
BRANCH 0000 - PNB SAVNGS BANK
CUSTOMER NAME CUSTOMER NBR CUSTOMER INITIATED?
TRAN DATE TIME FIELD DESCRIPTION ACT TRAN ID AFTER
EMPLOYEE TERMINAL LST MNT DATE LST MNT TIME BEFORE
KEY
CO, CARLOS VERA 00000004676090 N
09/03/18 10:21:42 RESP BR MNT RM1P 0000
15-000-1027993 B112 03/29/2017 02:16:23
09/03/18 10:21:42 SRC OF FUNDS MNT RM1P PENSION
15-000-1027993 B112 03/29/2017 02:16:23 SSS PENSIO
09/03/18 10:21:42 ACT OFFICER ID MNT RM1P 869376
15-000-1027993 B112 03/29/2017 02:16:23 00305294
09/03/18 10:21:42 DT LST RM ACTV MNT RM1P 20180903
15-000-1027993 B112 03/29/2017 02:16:23 20170329
09/03/18 10:21:42 CL RISK CLASS MNT RM1P B
15-000-1027993 B112 03/29/2017 02:16:23 C
09/03/18 10:21:42 CHK USER ID MNT RM1P 1027993
15-000-1027993 B112 03/29/2017 02:16:23 00144193
09/03/18 10:21:42 PH NBR MNT RM1P .
15-000-1027993 B112 03/29/2017 02:16:23 0 0 0
R 01 N
09/03/18 10:21:42 PH ISO CTRY CD MNT RM1P PH
15-000-1027993 B112 03/29/2017 02:16:23
R 01 N
09/03/18 10:21:42 PH NBR MNT RM1P 09091232585
15-000-1027993 B112 03/29/2017 02:16:23 639091239585
M 01 N
09/03/18 10:21:42 CITIZENSHIP MNT RM1P PH
15-000-1027993 B112 03/29/2017 02:16:23
09/03/18 10:21:42 SPOUSE NAME MNT RM1P CRISTINA GARCIA CO
15-000-1027993 B112 03/29/2017 02:16:23 CRISTINA CO
09/03/18 10:21:42 EMPR NAME ADD RM1P NA
15-000-1027993 B112 03/29/2017 02:16:23
00000000 00000000 NA
09/03/18 10:22:15 LENDING UNIT MNT RMLC 6041
15-000-1027993 B112 09/03/2018 10:21:42 1830
09/03/18 10:22:15 LOAN OFF MNT RMLC 869376
15-000-1027993 B112 09/03/2018 10:21:42 305294
CO, CARLOS VERA 00000004676090 N
09/03/18 10:22:15 CALC CRR MNT RMLC 5
15-000-1027993 B112 09/03/2018 10:21:42
It should be output like this :
http://i346.photobucket.com/albums/p421/Christopher_Alexis_Santor/Capture_zpspidlvxsa.png[^]
Thank you,
modified 14-Nov-18 19:05pm.
|
|
|
|
|
|
The problem is all of the dates are the same btw the text file is daily activity logs.
|
|
|
|
|
Sorry, but you have still not given a proper explanation of what you are trying to achieve.
|
|
|
|
|
hi sir,
I need to put the string from text file to datagridview but the dates and the other columns should be aligned with one another just like the output that i provided above. The linelength above is the customer no that is the length of the string which is set to 59 in the text file example is CO, CARLOS VERA 00000004676090 N
Here is the sample text file :
BANK NAME 15 CUSTOMER INFORMATION SYSTEM *RMR100 * PAGE NO 1
CTL 2 000 PNB SAVINGS BANK MONDAY PROCESS DATE 09/03/18
CTL 3 000 ACTIVITY *RM 100* PROCESS THRU 09/03/18
CTL 4 0000 CURRENT DATE 09/03/18
BRANCH 0000 - PNB SAVNGS BANK
CUSTOMER NAME CUSTOMER NBR CUSTOMER INITIATED?
TRAN DATE TIME FIELD DESCRIPTION ACT TRAN ID AFTER
EMPLOYEE TERMINAL LST MNT DATE LST MNT TIME BEFORE
KEY
CO, CARLOS VERA 00000004676090 N
09/03/18 10:21:42 RESP BR MNT RM1P 0000
15-000-1027993 B112 03/29/2017 02:16:23
09/03/18 10:21:42 SRC OF FUNDS MNT RM1P PENSION
15-000-1027993 B112 03/29/2017 02:16:23 SSS PENSIO
09/03/18 10:21:42 ACT OFFICER ID MNT RM1P 869376
15-000-1027993 B112 03/29/2017 02:16:23 00305294
09/03/18 10:21:42 DT LST RM ACTV MNT RM1P 20180903
15-000-1027993 B112 03/29/2017 02:16:23 20170329
09/03/18 10:21:42 CL RISK CLASS MNT RM1P B
15-000-1027993 B112 03/29/2017 02:16:23 C
09/03/18 10:21:42 CHK USER ID MNT RM1P 1027993
15-000-1027993 B112 03/29/2017 02:16:23 00144193
|
|
|
|
|
I still do not understand what the problem is. The solution to such a problem is reasonably simple:
- Read each line of text.
- Split the text into its separate fields.
- Add a new row to the datagrid.
- Add the data fields to the relevant columns of the row.
Since not all lines of the text file are in the same format you need to test which fields are contained in the line before adding them.
|
|
|
|
|
Member 13637678 wrote: It should be output like this : This will sound rude to you, but you either need to find a programmer, or learn the basics.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I had created a windows application thatcontains 4 forms and 1 class, the class is
Public Class cMyButton
Inherits Button
Dim m_Form As Form
Public Property FormToOpen As Form
Set(ByVal value As Form)
m_Form = value
End Set
Get
Return m_Form
End Get
End Property
Private Sub cMyButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
m_Form.ShowDialog()
End Sub
End Class
what i want is, when i put the control cMyButton to the stage, and i select the property FormToOpen from the property window, a menu including the 4 forms of the application appears to select one of them. now it appears only the current form
Hisham Shaaban
|
|
|
|
|
This is cute and all but this is kind of useless. ShowDialog returns a value about how the dialog was dismissed. You have no way of returning that value back to the code in the container of your button. The code will have no way of knowing if the dialog was modified and the data in it should be used or if it was canceled and the data ignored.
If you change the ShowDialog to just Show, you now have another problem. Forms have to be Disposed when you're done with them. Since the button code holds the reference to the form and the button Click handler will be done executing, the button will not be able to properly Dispose the form and your app will leak resources.
|
|
|
|
|
Hello All
I have multiple installers along with my application where in I want to bundle all of them to one single setup file. When user wants to install the software, I would like to make sure all installers install first before installing my application files.
Using MS Visual studio Installer project, I have tried to do this but failed to create a single setup file.
Request you to guide me or provide some pointers on how I can do this.
Best Regards
Sudhakar
|
|
|
|
|
Don't report the question in multiple forums.
Asked and answered in QA, here[^].
|
|
|
|
|
I am just learning. Im reading about garbage collection. The way I understand it, it frees up memory on the fly. I kind of think about it as running "clean up" on my pc. Is that a logical mental association or not?
|
|
|
|
|
In simplistic terms, yes. Though, it's not a machine wide thing. It only occurs in your application.
Garbage collection runs "once in a while". When an object goes out of scope in your code, the memory it occupies is not freed immediately. You just don't have access to the object any more. Depending on what your app is doing, has historic been doing, and the condition of memory available to Windows, it may be a while before a collection occurs.
Also, DO NOT use Task Manager to see how much memory your app is "using". It will lie to you. Use PerfMon and the .NET Memory counters instead.
|
|
|
|
|
Hi,
I'm trying to do something about Notes in Outlook, in that they're pretty much crap. With an Exchange server you can share notes with an iPhone, but if you write one in Outlook, the fonts are all weird on the phone, and so on - I have a feeling that they're getting stored on the server in RTF, but of course, Outlook has no real editor for these things, thus it's crying out for an upgrade.
I tried creating a new Form Region to edit the things, but notes don't seem to be a proper message class in Outlook, thus I can't find a way to replace the existing "Form" (if it can be called such a thing) with my own; I already know how to do this for something like a message, or a contact, or whatever, but the class for a Note doesn't seem to exist.
Also, you can create subfolders for notes if you view everything as a tree in the Navigation pane, but they don't show as subfolders in the Notes bit, but rather one under the other, which is also annoying. So:
1. Does anyone know how to write a form region which replaces the existing Note editor?
2. Does anyone know how to replace whatever the Notes Navigation Pane is?
Thanks...
|
|
|
|
|
I have excluded certain changes in Visual Studio 2017 to make sure that I will not accidentally check them in with another, necessary change. I have been working on the solution since and now I am sure that I will not need the excluded changes at all.
When I right click on the change and click undo, eventually there is a pop-up window asking if I wanted to undo check-out and discard changes. I have never checked out and I am not familiar with this window. There are 4 options other than Cancel: Yes; Yes to all; No; No to all.
Which one can I use safely if the server version is mapped to my local folder and I am currently editing the local version? What do these options actually mean?
I have not found an explanation so far for this specific topic. Many thanks in advance!
|
|
|
|
|
It's telling you that the files you have locally have changed and are now different from the server version.
If you click Yes To All, the files you have locally will be overwritten by the versions on the server. This will revert the changes you made to those files back to the point where they were checked out on the server.
Yes, they are checked out. That happened automatically the instant you started making changes to files. Each file you make changes to will be automatically checked out.
|
|
|
|
|
|
srsly?
There are enough examples on this website.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Has anyone programmed one of these? My company is using these types of transfers for distributed control, their choice of data format is XML. I need some examples so I can see if I can incorporate it into the HMI software we are going to start to use. Indusoft, formerly Wonderware.
j
|
|
|
|