how to check if the log-in exists in sql server?
Date : March 29 2020, 07:55 AM
hop of those help? I am creating a new login in my SQL Server and I want to check if the login exists, if not, then I have to execute the following query to create a new login. , Try querying select name from master..syslogins
|
Check if directory exists on FTP server
Tag : chash , By : August
Date : March 29 2020, 07:55 AM
it should still fix some issue I'm running a check to see if a directory exists on my FTP server: , I successfully solved this issue by changing my directory to be: directory = @"ftp://ftp.example.com/Rubicon/";
|
Check if URL exists or not on Server
Date : March 29 2020, 07:55 AM
it fixes the issue You will get Network On Main Thread Exception Look at NetworkOnMainThreadException catch (Exception e) {
e.printStackTrace();
return false;
}
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String customURL = "http://www.desicomments.com/dc3/08/273858/273858.jpg";
MyTask task = new MyTask();
task.execute(customURL);
}
private class MyTask extends AsyncTask<String, Void, Boolean> {
@Override
protected void onPreExecute() {
}
@Override
protected Boolean doInBackground(String... params) {
try {
HttpURLConnection.setFollowRedirects(false);
HttpURLConnection con = (HttpURLConnection) new URL(params[0]).openConnection();
con.setRequestMethod("HEAD");
System.out.println(con.getResponseCode());
return (con.getResponseCode() == HttpURLConnection.HTTP_OK);
}
catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
protected void onPostExecute(Boolean result) {
boolean bResponse = result;
if (bResponse==true)
{
Toast.makeText(MainActivity.this, "File exists!", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(MainActivity.this, "File does not exist!", Toast.LENGTH_SHORT).show();
}
}
}
}
public class MainActivity extends Activity {
String customURL;
String msg = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
customURL = "http://www.desicomments.com/dc3/08/273858/273858.jpg";
final ScheduledThreadPoolExecutor myTimer = new ScheduledThreadPoolExecutor(1);
myTimer.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
try {
HttpURLConnection.setFollowRedirects(false);
HttpURLConnection con = (HttpURLConnection) new URL(customURL).openConnection();
con.setRequestMethod("HEAD");
System.out.println(con.getResponseCode());
if(con.getResponseCode() == HttpURLConnection.HTTP_OK){
msg = "File exist!";
}else{
msg = "File does not exist!";
}
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show();
}
});
}
catch (Exception e) {
e.printStackTrace();
return;
}
}
}, 0,10000, TimeUnit.MILLISECONDS);
}
|
check if php file exists on server
Tag : php , By : user184415
Date : March 29 2020, 07:55 AM
To fix the issue you can do To check the local server filesystem, you need to get the path component from the URL: var_dump(file_exists($_SERVER['DOCUMENT_ROOT'] . parse_url($acf_funcs, PHP_URL_PATH)));
parse_url($acf_funcs, PHP_URL_PATH)
|
How to check if an Azure Sql Server server principal (Login) already exists
Tag : azure , By : Jorge Palacio
Date : January 09 2021, 05:38 AM
I wish this help you The following script will create the login on the master database at the logical Azure SQL server level. IF NOT EXISTS (SELECT * FROM sys.sql_logins WHERE name = 'simonel')
CREATE LOGIN simonel WITH PASSWORD = 'BS#ah12!!@#'
ELSE
PRINT 'Already exist'
IF NOT EXISTS (SELECT * FROM sys.sysusers WHERE name='simonel')
CREATE USER simonel FOR LOGIN Blah WITH DEFAULT_SCHEMA = dbo
ELSE
PRINT 'Already exists'
|